kmeans | R Documentation |
K-means Clustering
kmeans(
data,
vars,
factors,
k = 2,
k1 = 2,
kp = FALSE,
oc = FALSE,
algo = "Hartigan-Wong",
nstart = 10,
stand = FALSE,
plot = FALSE,
angle = 0,
plot1 = FALSE,
plot2 = FALSE,
plot3 = FALSE,
width = 500,
height = 500,
width1 = 500,
height1 = 500,
width2 = 500,
height2 = 500,
width3 = 500,
height3 = 500,
plot4 = FALSE,
width4 = 500,
height4 = 500
)
data |
The data as a data frame. |
vars |
. |
factors |
. |
k |
. |
k1 |
. |
kp |
. |
oc |
. |
algo |
. |
nstart |
. |
stand |
. |
plot |
. |
angle |
a number from 0 to 90 defining the angle of the x-axis labels, where 0 degrees represents completely horizontal labels. |
plot1 |
. |
plot2 |
. |
plot3 |
. |
width |
. |
height |
. |
width1 |
. |
height1 |
. |
width2 |
. |
height2 |
. |
width3 |
. |
height3 |
. |
plot4 |
. |
width4 |
. |
height4 |
. |
A results object containing:
results$instructions | a html | ||||
results$text | a preformatted | ||||
results$ss | a table | ||||
results$clustering | a table | ||||
results$centroids | a table | ||||
results$plot | an image | ||||
results$plot1 | an image | ||||
results$plot2 | an image | ||||
results$plot3 | an image | ||||
results$clust | an output | ||||
results$clust1 | an output | ||||
results$oc | a table | ||||
results$kp | a table | ||||
results$plot4 | an image | ||||
Tables can be converted to data frames with asDF
or as.data.frame
. For example:
results$ss$asDF
as.data.frame(results$ss)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.