combine {intervals}R Documentation

Combine different interval matrix objects

Description

Stack objects just like rbind. Since S4 methods cannot easily be written for rbind due to the lack of named arguments, we following the Biobase convention instead.

Usage

combine(x, y, ...)

Arguments

x An "Intervals" or "Intervals_full" object.
y An "Intervals" or "Intervals_full" object.
... More of the same.

Details

All objects are expected to have the same value in the type slot. If the closed slots differ for Intervals objects and type == "Z", the objects will be adjusted to have closed values matching that of x; if type == "R", however, then all objects must first be coerced to class Intervals_full. This coercion also occurs when a mixture of object types is passed in. A NULL in any argument is ignored.

Value

If no arguments are supplied, combine returns NULL, similar to rbind. In all other cases, objects are stacked in their order of appearance in the the argument list.

Note

The "missing" method permits convenient use of do.call with named lists. In such cases, do.call will only put list elements into the x or y arguments if they are explicitly named as such; otherwise, everything ends up in ... and x and y are left empty. The "missing" method just strips names from the elements of ... and then reapplies the method. Warning! Applying do.call to a named list which coincidentally has named elements "x" or "y" may cause an unexpected reordering before combining.

Examples

f1 <- Intervals( 1:2, type = "Z" )
g1 <- open_intervals( f1 + 5 )

# Combining Intervals objects over Z may require closure adjustment
combine( f1, g1 )

f2 <- f1; g2 <- g1
type( f2 ) <- type( g2 ) <- "R"

# Combine Intervals objects over R which have different closure requires
# coercion

h <- combine( f2, g2 )

# Coercion for mixed combinations as well
combine( h, g2 + 10 )

## Not run: 

# Combining different types is not permitted
combine( h, g1 + 10 )

## End(Not run)

[Package intervals version 0.9.5 Index]