which_dim-methods: Find Dimensions of a Given Axis

which_dimR Documentation

Find Dimensions of a Given Axis

Description

This function returns the dimension of the specified axis for a given object, such as a matrix or an array.

Usage

which_dim(x, axis)

## S4 method for signature 'NeuroSpace,NamedAxis'
which_dim(x, axis)

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.

Value

An integer representing the dimension of the specified axis for the given object.

Examples


x <- NeuroSpace(c(10,10,10), spacing=c(1,1,1))
which_dim(x, x@axes@j) == 2


bbuchsbaum/neuroim2 documentation built on Nov. 3, 2024, 9:31 a.m.