ctCollapse: ctCollapse Easily collapse an array margin using a specified...

View source: R/ctsemUtils.R

ctCollapseR Documentation

ctCollapse Easily collapse an array margin using a specified function.

Description

ctCollapse Easily collapse an array margin using a specified function.

Usage

ctCollapse(inarray, collapsemargin, collapsefunc, plyr = TRUE, ...)

Arguments

inarray

Input array of more than one dimension.

collapsemargin

Integers denoting which margins to collapse.

collapsefunc

function to use over the collapsing margin.

plyr

Whether to use plyr.

...

additional parameters to pass to collapsefunc.

Examples

testarray <- array(rnorm(900,2,1),dim=c(100,3,3))
ctCollapse(testarray,1,mean)

ctsem documentation built on Sept. 11, 2024, 9:06 p.m.