Learn R Programming

ctsem (version 2.1.0)

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, ...)

Arguments

inarray
Input array of more than one dimension.
collapsemargin
Integers denoting which margins to collapse.
collapsefunc
function to use over the collapsing margin.
...
additional parameters to pass to collapsefunc.

Examples

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

Run the code above in your browser using DataLab