# load data
data("banknote")
dat <- banknote[-1]
# fit 2 clusters
set.seed(123)
fit <- gmix(dat, K = 2, init.nstart = 1)
print(fit)
# plot partition (default)
plot(x = fit, data = dat)
# \donttest{
# plot partition onto the first 3 coordinates
plot(x = fit, data = dat, subset = c(1:3), pch_cl = c("A", "B"),
col_cl = c("#4285F4", "#0F9D58"), what = "clustering")
# additionally plot clustering boundary and contour sets
plot(x = fit, data = dat, subset = c(1:3), pch_cl = c("A", "B"),
col_cl = c("#4285F4", "#0F9D58"), what = c("clustering", "boundary", "contour"))
# }
Run the code above in your browser using DataLab