This function returns the dimension of the specified axis for a given object, such as a matrix or an array.
Arguments
- x
An object representing the input data, such as a matrix or an array.
- axis
An integer representing the axis for which the dimension is requested. For example, 1 for rows, 2 for columns, or 3 for the depth in a 3D array.
Examples
x <- NeuroSpace(c(10,10,10), spacing=c(1,1,1))
which_dim(x, x@axes@j) == 2
#> [1] TRUE