clusterRows | R Documentation |
Cluster rows of a matrix-like object with a variety of algorithms.
clusterRows(x, BLUSPARAM, full = FALSE)
x |
A numeric matrix-like object where rows represent observations and columns represent variables. |
BLUSPARAM |
A BlusterParam object specifying the algorithm to use. |
full |
Logical scalar indicating whether the full clustering statistics should be returned for each method. |
This generic allows users to write agile code that can use a variety of clustering algorithms.
By simply changing BLUSPARAM
, we can tune the clustering procedure in analysis workflows and package functions.
By default, a factor of length equal to nrow(x)
containing cluster assignments for each row of x
.
If full=TRUE
, a list is returned containing clusters
, a factor as described above;
and objects
, an arbitrary object containing algorithm-specific statistics or intermediate objects.
Aaron Lun
HclustParam, KmeansParam and NNGraphParam
for some examples of values for BLUSPARAM
.
m <- matrix(runif(10000), ncol=10)
clusterRows(m, KmeansParam(10L))
clusterRows(m, HclustParam())
clusterRows(m, NNGraphParam())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.