Description Usage Arguments Details Author(s) Examples
Visualization of a kprototypes clustering result for cluster interpretation.
1  clprofiles(object, x, vars = NULL, col = NULL)

object 
Object resulting from a call of resulting 
x 
Original data. 
vars 
Optional vector of either column indices or variable names. 
col 
Palette of cluster colours to be used for the plots. As a default RColorBrewer's

For numerical variables boxplots and for factor variables barplots of each cluster are generated.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34  # generate toy data with factors and numerics
n < 100
prb < 0.9
muk < 1.5
clusid < rep(1:4, each = n)
x1 < sample(c("A","B"), 2*n, replace = TRUE, prob = c(prb, 1prb))
x1 < c(x1, sample(c("A","B"), 2*n, replace = TRUE, prob = c(1prb, prb)))
x1 < as.factor(x1)
x2 < sample(c("A","B"), 2*n, replace = TRUE, prob = c(prb, 1prb))
x2 < c(x2, sample(c("A","B"), 2*n, replace = TRUE, prob = c(1prb, prb)))
x2 < as.factor(x2)
x3 < c(rnorm(n, mean = muk), rnorm(n, mean = muk), rnorm(n, mean = muk), rnorm(n, mean = muk))
x4 < c(rnorm(n, mean = muk), rnorm(n, mean = muk), rnorm(n, mean = muk), rnorm(n, mean = muk))
x < data.frame(x1,x2,x3,x4)
# apply kprototyps
kpres < kproto(x, 4)
clprofiles(kpres, x)
# in real world clusters are often not as clear cut
# by variation of lambda the emphasize is shifted towards factor / numeric variables
kpres < kproto(x, 2)
clprofiles(kpres, x)
kpres < kproto(x, 2, lambda = 0.1)
clprofiles(kpres, x)
kpres < kproto(x, 2, lambda = 25)
clprofiles(kpres, x)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.