kmeans.fraction: k-means fraction

View source: R/kmeans.fraction.R

kmeans.fractionR Documentation

k-means fraction

Description

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.

Usage

kmeans.fraction(x)

Arguments

x

A numeric vector.

Details

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.

Value

A number.

Examples

x <- c(1, 1, 2, 2, 2, 2, 2, 2, 2, 2);
names(x) <- letters[1:length(x)];
kmeans.fraction(x);

OutSeekR documentation built on April 11, 2025, 5:39 p.m.