trinarize.kMeans {BiTrinA} | R Documentation |
k-means Trinarization
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
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 |
iter.max |
The maximum number of iterations for k-means. See |
dip.test |
If set to |
na.rm |
If set to |
Value
Returns an object of class TrinarizationResult
.
See Also
Examples
result <- trinarize.kMeans(iris[,"Petal.Length"])
print(result)
plot(result, twoDimensional=TRUE)