ctsem (version 3.0.4)

ctCollapse: 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

Run this code
# NOT RUN {
testarray <- array(rnorm(900,2,1),dim=c(100,3,3))
ctCollapse(testarray,1,mean)
# }

Run the code above in your browser using DataLab