View source: R/kmeans.fraction.R
kmeans.fraction | R Documentation |
Given a vector of cluster assigments from quantify.outliers()
run with method = 'kmeans'
, compute the fraction of observations belonging to the smaller of the two clusters.
kmeans.fraction(x)
x |
A numeric vector. |
This function only considers clusters 1 and 2 even if quantify.outliers()
was run with exclude.zero = TRUE
. In that case, zeros are effectively excluded from the counts used to define the k-means fraction. See examples.
A number.
x <- c(1, 1, 2, 2, 2, 2, 2, 2, 2, 2);
names(x) <- letters[1:length(x)];
kmeans.fraction(x);
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.