rray_combine: Combine arrays along an existing axis

View source: R/combine.R

rray_combineR Documentation

Combine arrays along an existing axis

Description

rray_combine() joins one or more arrays along .axis. Dimensions on every other axis are broadcast to common dimensions.

Usage

rray_combine(..., .axis)

Arguments

...

Arrays to combine.

.axis

The axis to combine along, given by position. Must be between 1 and the greatest input dimensionality.

Details

This function participates in rray's common name determination rules. Names on .axis are never checked. They are pasted together from every input, with "" for inputs that have none.

Value

An array with the following dimensions:

  • Along .axis, the input dimensions are added together.

  • Along all other axes, the common dimensions are taken via broadcasting.

Examples

x <- array(1:6, c(2, 3))
y <- array(7:12, c(2, 3))

rray_combine(x, y, .axis = 1)
rray_combine(x, y, .axis = 2)

# Missing trailing axes have an implicit dimension of 1
rray_combine(1:2, array(3:8, c(2, 3)), .axis = 2)

rray documentation built on Nov. 17, 2026, 5:07 p.m.