collapse | R Documentation |
Column-wise average a matrix of variables, collapsing over some set of factors
collapse(form, X, design)
form |
the formula defining the model to collapse over |
X |
the matrix to collpased over rows |
design |
the |
X <- matrix(rnorm(20*10), 20, 10) des <- data.frame(a=rep(letters[1:4], 5), b=factor(rep(1:5, each=4))) xcoll <- collapse(~ a+b, X, design=des)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.