kmeans {Kira} | R Documentation |
kmeans unsupervised classification.
Description
Performs kmeans unsupervised classification analysis in a data set.
Usage
kmeans(data, normalize = FALSE, num.groups = 2)
Arguments
data |
Data to be analyzed. |
normalize |
Normalize the data (default = FALSE). |
num.groups |
Number of groups to be formed (default = 2). |
Value
groups |
Original data with groups formed. |
res.groups |
Results of the groups formed. |
R.sqt |
Result of the R squared. |
sum.sqt |
Total sum of squares. |
Author(s)
Paulo Cesar Ossani
References
Rencher, A. C. Methods of multivariate analysis. 2th. ed. New York: J.Wiley, 2002. 708 p.
Mingoti, S. A. analysis de dados atraves de metodos de estatistica multivariada: uma abordagem aplicada. Belo Horizonte: UFMG, 2005. 297 p.
Ferreira, D. F. Estatistica Multivariada. 2a ed. revisada e ampliada. Lavras: Editora UFLA, 2011. 676 p.
Examples
data(iris) # data set
data <- iris
res <- kmeans(data[,1:4], normalize = FALSE, num.groups = 3)
message("R squared: ", res$R.sqt)
# message("Total sum of squares: ", res$sum.sqt)
message("Groups formed:"); res$groups
# message("Table with the results of the groups:"); res$res.groups
#write.table(file=file.path(tempdir(),"GroupData.csv"), res$groups, sep=";",
# dec=",",row.names = TRUE)
[Package Kira version 1.0.5 Index]