Learn R Programming

neuroim (version 0.0.6)

concat: Concatenate two objects

Description

Concatenate two objects

Usage

concat(x, y, ...)
"concat"(x, y, ...)
"concat"(x, y, ...)
"concat"(x, y, ...)
"concat"(x, y, ...)
"concat"(x, y, ...)

Arguments

x
the first object, typically BrainVolume or BrainVector
y
the second object, typically BrainVolume or BrainVector
...
additional objects

Details

The x and y images must have compatible dimensions. a BrainVolume can be concatenated to BrainVector, and vice versa. See examples.

Examples

Run this code
bv1 <- BrainVolume(rep(1,1000), BrainSpace(c(10,10,10), c(1,1,1)))
bv2 <- BrainVolume(rep(2,1000), BrainSpace(c(10,10,10), c(1,1,1)))
bv3 <- concat(bv1,bv2)
inherits(bv3, "BrainVector")

bv4 <- concat(bv3, bv1)
dim(bv4)[4] == 3
bv5 <- concat(bv1, bv3)
dim(bv4)[4] == 3

bv6 <- concat(bv4,bv5)
dim(bv6)[4] == 6

Run the code above in your browser using DataLab