apply_xifti: Apply a function along the rows or columns of a '"xifti"'

View source: R/apply_xifti.R

apply_xiftiR Documentation

Apply a function along the rows or columns of a "xifti"

Description

Apply a many-to-N function (e.g. mean) to the rows or columns of a "xifti". If applied row-wise, a "xifti" with N data column(s) is returned. (If the "xifti" had the dlabel intent, and values that are not labels are created, then it is converted to dscalar.) If applied column-wise, a numeric matrix with N rows is returned.

For univariate functions, use transform_xifti instead.

Usage

apply_xifti(xifti, margin = c(1, 2), FUN, ...)

Arguments

xifti

A "xifti" object.

margin

The dimension along which to apply FUN: 1 for rows (default) and 2 for columns.

FUN

The function. It should take in a numeric vector and return a length-N numeric vector.

...

Additional arguments to FUN

Value

A "xifti" if margin == 1, or a numeric matrix if margin == 2

See Also

Other manipulating xifti: add_surf(), apply_parc(), combine_xifti(), convert_to_dlabel(), merge_xifti(), move_to_mwall(), move_to_submask(), newdata_xifti(), remap_cifti(), remove_xifti(), resample_cifti(), resample_cifti_from_template(), scale_xifti(), select_xifti(), set_names_xifti(), smooth_cifti(), transform_xifti()


ciftiTools documentation built on Oct. 4, 2024, 1:12 a.m.