powered by
This function adds a new dimension to a given object, such as a matrix or an array.
add_dim(x, n)# S4 method for NeuroSpace,numeric add_dim(x, n)
# S4 method for NeuroSpace,numeric add_dim(x, n)
An object of the same class as x with the new dimension added.
x
The NeuroSpace object
Numeric value specifying the size of the new dimension
# Create a NeuroSpace object x <- NeuroSpace(c(10, 10, 10), c(1, 1, 1)) # Add a new dimension with size 10 x1 <- add_dim(x, 10) # Check the new dimension ndim(x1) == 4 dim(x1)[4] == 10
Run the code above in your browser using DataLab