trinarizeKMeans: k-means Trinarization

Description Usage Arguments Value See Also Examples

Description

Trinarizes a vector of real-valued data using the k-means clustering algorithm. The data is first split into 3 clusters.The values belonging to the cluster with the smallest centroid are set to 0, the values belonging to the greater centroid are set to 1, and the values belonging to the greatest centroid are set to 2.

Usage

1
2
3
4
5
trinarize.kMeans(vect, 
                nstart=1, 
                iter.max=10,
                dip.test=TRUE,
                na.rm=FALSE)

Arguments

vect

A real-valued vector to be trinarized.

nstart

The number of restarts for k-means. See kmeans for details.

iter.max

The maximum number of iterations for k-means. See kmeans for details.

dip.test

If set to TRUE, Hartigan's dip test for unimodality is performed on vect, and its p-value is returned in the pvalue slot of the result. An insignificant test indicates that the data may not be trinarizeable.

na.rm

If set to TRUE, NA values are removed from the input. Otherwise, trinarization will fail in the presence of NA values.

Value

Returns an object of class TrinarizationResult.

See Also

kmeans, TrinarizationResult

Examples

1
2
3
4
result <- trinarize.kMeans(iris[,"Petal.Length"])

print(result)
plot(result, twoDimensional=TRUE)

BiTrinA documentation built on May 30, 2017, 8:07 a.m.