Skip to contents

Returns the number of elements (e.g., fixels or voxels) for a given scalar in a ModelArray. This is the row count of the scalar matrix.

Usage

nElements(x, scalar = NULL)

# S4 method for class 'ModelArray'
nElements(x, scalar = NULL)

Arguments

x

A ModelArray object.

scalar

Optional character string. Name of the scalar to query. Defaults to the first scalar in names(scalars(x)).

Value

Integer. The number of elements (rows) in the scalar matrix.

Examples

if (FALSE) { # \dontrun{
ma <- ModelArray("data.h5", scalar_types = c("FD"))
nElements(ma)
nElements(ma, "FD")
} # }