Visualize cluster data for assorted values of k.
clusterVisualK(df, ks = 1:6, ...)
Dataframe
Integer vector. Which k should be tested?
Additional parameters passed to clusterKmeans
List. Plot and data.frame results of clustering df
data.frame into ks
integer clusters.
Other Clusters:
clusterKmeans()
,
clusterOptimalK()
# NOT RUN {
Sys.unsetenv("LARES_FONT") # Temporal
data("iris")
df <- subset(iris, select = c(-Species))
# Calculate and plot
result <- clusterVisualK(df)
# You can use the data generated as well
lapply(result$data, function(x) head(x$cluster))
# }
Run the code above in your browser using DataLab