Last data update: 2014.03.03

R: Plot of the obtained clustering solution
click.plotR 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. (2014) Model-based biclustering of clickstream data, accepted by Computational Statistics & Data Analysis.

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)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(ClickClust)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/ClickClust/ClickPlot.Rd_%03d_medium.png", width=480, height=480)
> ### Name: click.plot
> ### Title: Plot of the obtained clustering solution
> ### Aliases: click.plot
> ### Keywords: click-plot EM algorithm Markov model
> 
> ### ** 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)
> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>