dbind | R Documentation |
These methods can bind two or more objects of array-based classes (e.g. FLQuant), along the specified dimension.
dbind(x, y, ...)
## S4 method for signature 'FLArray,FLArray'
dbind(x, y, ..., dim = 1)
qbind(...)
ybind(...)
ubind(...)
sbind(...)
abind(...)
ibind(...)
x |
First object to bind |
y |
Second object to bind |
... |
Other objects to bind |
dim |
Dimension to bind on, numeric or character. |
The objects to bind must contain the same dimmames in all dimensions other than that used to bind, while dimnames in the selected one must differ. See the examples below for correct and incorrect uses.
Object are bound in the order they are provided, with no attempt to sort according to the dimnames of the chosen dimension.
The implementation is based around a single method (dbind), that operates along the dimension position or name indicated by the dim argument. A series of shortcut functions call the method for specific dimensions, with names related to the dimensions name they operate on (e.g. ybind for year).
An object of the same class as the inputs
Iago Mosqueira (EC JRC)
FLQuant
FLArray
# By iter
x <- FLQuant(rnorm(80000), dim=c(4,20,1,1,1,1000))
y <- FLQuant(rnorm(80000), dim=c(4,20,1,1,1,1000))
dimnames(y) <- list(iter=1001:2000)
ibind(x,y)
# By quant (age)
x <- FLQuant(1, dimnames=list(age=1:3, year=1:10))
y <- FLQuant(2, dimnames=list(age=4:12, year=1:10))
qbind(x, y)
# By year
x <- FLQuant(1, dimnames=list(age=1:3, year=1:10))
y <- FLQuant(2, dimnames=list(age=1:3, year=11:20))
z <- FLQuant(3, dimnames=list(age=1:3, year=21:30))
ybind(x, y, z)
# By season
x <- FLQuant(1, dimnames=list(year=1:10, season=1:2))
y <- FLQuant(2, dimnames=list(year=1:10, season=3:4))
sbind(x, y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.