click.plot {ClickClust} | R Documentation |
Plot of the obtained clustering solution
Description
Constructs a click-plot for the clustering solution.
Usage
click.plot(X, y = NULL, file = NULL, id, states = NULL, marg = 1,
font.cex = 2, font.col = "black", cell.cex = 1, cell.lwd = 1.3,
cell.col = "black", sep.lwd = 1.3, sep.col = "black",
obs.lwd = NULL, colors = c("lightcyan", "pink", "darkred"),
col.levels = 8, legend = TRUE, leg.cex = 1.3, top.srt = 0,
frame = TRUE)
Arguments
X |
dataset array (p x p x n) |
y |
vector of initial states (length n) |
file |
name of the output pdf-file |
id |
classification vector (length n) |
states |
vector of state labels (length p) |
marg |
plot margin value (for the left and top) |
font.cex |
magnification of labels |
font.col |
color of labels |
cell.cex |
magnification of cells |
cell.lwd |
width of cell frames |
cell.col |
color of cell frames |
sep.lwd |
width of separator lines |
sep.col |
color of separator lines |
obs.lwd |
width of observation lines |
colors |
edge colors for interpolation |
col.levels |
number of colors obtained by interpolation |
legend |
legend of color hues |
leg.cex |
magnification of legend labels |
top.srt |
rotation of state names in the top |
frame |
frame around the plot |
Details
Constructs a click-plot for the provided clustering solution. Click-plot is a graphical display representing relative transition frequencies for the partitioning specified via the parameter 'id'. If the parameter 'file' is specified, the constructed plot will be saved in the pdf-file with the name 'file'. If the width of observation lines 'obs.lwd' is not specified, median colors will be used for all cell segments.
Author(s)
Melnykov, V.
References
Melnykov, V. (2016) Model-Based Biclustering of Clickstream Data, Computational Statistics and Data Analysis, 93, 31-45.
Melnykov, V. (2016) ClickClust: An R Package for Model-Based Clustering of Categorical Sequences, Journal of Statistical Software, 74, 1-34.
See Also
click.EM
Examples
set.seed(123)
n.seq <- 200
p <- 5
K <- 2
mix.prop <- c(0.3, 0.7)
TP1 <- matrix(c(0.20, 0.10, 0.15, 0.15, 0.40,
0.20, 0.20, 0.20, 0.20, 0.20,
0.15, 0.10, 0.20, 0.20, 0.35,
0.15, 0.10, 0.20, 0.20, 0.35,
0.30, 0.30, 0.10, 0.10, 0.20), byrow = TRUE, ncol = p)
TP2 <- matrix(c(0.15, 0.15, 0.20, 0.20, 0.30,
0.20, 0.10, 0.30, 0.30, 0.10,
0.25, 0.20, 0.15, 0.15, 0.25,
0.25, 0.20, 0.15, 0.15, 0.25,
0.10, 0.30, 0.20, 0.20, 0.20), byrow = TRUE, ncol = p)
TP <- array(rep(NA, p * p * K), c(p, p, K))
TP[,,1] <- TP1
TP[,,2] <- TP2
# DATA SIMULATION
A <- click.sim(n = n.seq, int = c(10, 50), alpha = mix.prop, gamma = TP)
C <- click.read(A$S)
# EM ALGORITHM
M2 <- click.EM(X = C$X, y = C$y, K = 2)
# CONSTRUCT CLICK-PLOT
click.plot(X = C$X, y = C$y, file = NULL, id = M2$id)