BindDim: Bind two arrays by a specified named dimension

View source: R/CST_BindDim.R

BindDimR Documentation

Bind two arrays by a specified named dimension

Description

This function combines the data inside two or more arrays with named dimensions along the specified along dimension. It is a wrapper of the abind() function from the abind package.

Usage

BindDim(x, along)

Arguments

x

A list of two or more arrays with named dimensions to be bound together.

along

A character string indicating the name of the binding dimension.

Value

A single array combining the arrays in x along the specified dimension, with dimension names. The order of the dimensions will be the same as in the first array provided in the list.

Author(s)

Agudetse Roures Victoria, victoria.agudetse@bsc.es

See Also

abind

Examples

array1 <- array(1:100, dim = c(time = 1, lon = 10, lat = 10))
array2 <- array(101:200, dim = c(lon = 10, lat = 10, time = 1))
# Bind arrays
array3 <- BindDim(x = list(array1, array2),
                 along = "time")
# Check new dimensions
dim(array3)


CSTools documentation built on Nov. 14, 2025, 5:07 p.m.