Description Usage Arguments Details Value
View source: R/centerDataTwoGroupsByIndices.R
This function takes a data matrix and returns a centered data matrix. For each column, centering is performed by subtracting the corresponding group mean from each entry (i.e. for entries in group one, the group one mean is subtracted, and for entries in group two, the group two mean is subtracted).
1 | centerDataTwoGroupsByIndices(X, group.one.indices, group.two.indices)
|
X |
a data matrix. |
group.one.indices |
indices of observations in group one. |
group.two.indices |
indices of observations in group two. |
Example
1 2 3 | X <- matrix(1:12, nrow=4, ncol=3)
X.cen <- centerDataTwoGroupsByIndices(
X, group.one.indices=1:2, group.two.indices=3:4)
|
Returns a centered data matrix of the same dimensions as the original data matrix.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.