dim_of-methods: Get the length of a given dimension of an object

dim_ofR Documentation

Get the length of a given dimension of an object

Description

This function returns the length of a given axis (dimension) of an object. The axis can be specified using its position or name.

Usage

dim_of(x, axis)

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

Arguments

x

the object whose axis to query

axis

an integer or character string indicating which axis to query

Value

An integer representing the length of the specified axis.

Examples


x <- NeuroSpace(c(10,10,10), spacing=c(1,1,1))
stopifnot(dim_of(x, x@axes@i) == 10)

bbuchsbaum/neuroim2 documentation built on Jan. 2, 2025, 3:38 p.m.