add_dim | R Documentation |
This function adds a new dimension to a given object, such as a matrix or an array.
add_dim(x, n)
## S4 method for signature 'NeuroSpace,numeric'
add_dim(x, n)
x |
A dimensioned object, such as a matrix, an array, or a NeuroSpace object. |
n |
An integer representing the size of the dimension to add. |
An updated dimensioned object with the new dimension added.
# 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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.