dbind-methods: Methods for binding objects of array classes along a given...

dbindR Documentation

Methods for binding objects of array classes along a given dimension

Description

These methods can bind two or more objects of array-based classes (e.g. FLQuant), along the specified dimension.

Usage

dbind(x, y, ...)

## S4 method for signature 'FLArray,FLArray'
dbind(x, y, ..., dim = 1)

qbind(...)

ybind(...)

ubind(...)

sbind(...)

abind(...)

ibind(...)

Arguments

x

First object to bind

y

Second object to bind

...

Other objects to bind

dim

Dimension to bind on, numeric or character.

Details

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).

Value

An object of the same class as the inputs

Author(s)

Iago Mosqueira (EC JRC)

See Also

FLQuant FLArray

Examples


# 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)

flr/FLCore documentation built on May 4, 2024, midnight