clusterVisualK: Visualize K-Means Clusters for Several K

clusterVisualKR Documentation

Visualize K-Means Clusters for Several K

Description

Visualize cluster data for assorted values of k.

Usage

clusterVisualK(df, ks = 2:6, ...)

Arguments

df

Dataframe

ks

Integer vector. Which k should be tested?

...

Additional parameters passed to clusterKmeans

Value

List. Plot and data.frame results of clustering df data.frame into ks integer clusters.

See Also

Other Clusters: clusterKmeans(), clusterOptimalK(), reduce_pca(), reduce_tsne()

Examples

Sys.unsetenv("LARES_FONT") # Temporal
data("iris")
df <- subset(iris, select = c(-Species))
df <- df[sample(nrow(df)), ]

# Calculate and plot
result <- clusterVisualK(df, ks = 2:4)
plot(result$plot)

# You can use the data generated as well
lapply(result$data, function(x) head(x$cluster, 10))

laresbernardo/lares documentation built on Oct. 23, 2024, 12:05 p.m.