# Example data
set.seed(123)
data <- rbind(
matrix(rnorm(100 * 2), ncol = 2),
matrix(rnorm(100 * 2) + 2, ncol = 2)
)
cluster <- c(rep(1, 100), rep(2, 100))
params <- clust2params(data, cluster)
# Plot with clustering information
plot_clustering(data, cluster = cluster, what = "clustering")
# Plot with subset of variables
plot_clustering(data, cluster = cluster, subset = 1, what = c("clustering", "contour"))
# Plot with customized colors and symbols
plot_clustering(data, cluster = cluster, params = params,
col_cl = c("magenta", "orange"), pch_cl = c("A", "B"))
Run the code above in your browser using DataLab