Description Usage Arguments Value See Also Examples
View source: R/CentrePerGroup.R
Mean centering of an input matrix. When true labels are provided, the groups/clusters are centred individually.
1 | CentrePerGroup(xx, true_labels = numeric(nrow(xx)))
|
xx |
The data matrix (n x p). |
true_labels |
Vector of true cluster assignments. Default: 0 (all elements are treated as belonging to one group). |
xx_centred |
Mean centred data matrix. |
1 2 3 4 5 6 7 8 | ## 10x5 matrix, 1 group:
CentrePerGroup(xx=matrix(rnorm(50),10,5))
## 2 groups:
CentrePerGroup(xx=matrix(rnorm(50),10,5), true_labels=round(runif(10)))
## 10 groups:
CentrePerGroup(xx=matrix(rnorm(5000),100,50), true_labels=round(runif(100)*10))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.