CPCP gallery

data(Titanic)
titanic <- as.data.frame(Titanic)

# the default

scpcp(titanic)

plot of chunk unnamed-chunk-2

# no rectangles

scpcp(titanic, level.width = 0)

plot of chunk unnamed-chunk-3

# no gaps between levels

scpcp(titanic, gap = 0)

plot of chunk unnamed-chunk-4

# default with highlighting

scpcp(titanic, sel = "data[,4]")

plot of chunk unnamed-chunk-5

# random color vector: cases are sorted by color vaiable

scpcp(titanic, sel = "sample(1:6,nrow(data),T)", sel.hide = FALSE)

plot of chunk unnamed-chunk-6

# Survivors among men and some layout changes

scpcp(data = titanic, sel = "Sex==levels(Sex)[1] & Survived==levels(Survived)[1]", 
    sel.palette = "w", col.opt = list(alpha = 0.7, border = alpha(1, 0.3)), 
    gap = 0.5, level.width = 0.3)

plot of chunk unnamed-chunk-7

# mushroom data from the UCI machine learning repository

MR <- read.table("http://rosuda.org/mitarbeiter/pilhoefer/agaricus.dat", sep = "\t", 
    quote = "", header = TRUE)

levels(MR$stalk_root) <- c(levels(MR$stalk_root), "N/A")
MR$stalk_root[which(is.na(MR$stalk_root))] <- "N/A"

op <- optile(MR[, 1:12], method = "joint")
scpcp(op, sel = "odor", sel.palette = "w", col.opt = list(border = alpha(1, 
    0.1)), lab.opt = list(rot = 45))

plot of chunk unnamed-chunk-9

“# ADAC ecotest data with four clusterings (k-means, mclust, hierarchical Ward, hierarchical complete)


```r
eco <- read.table("http://rosuda.org/mitarbeiter/pilhoefer/eco2plus.dat", sep = "\t", 
    quote = "", header = TRUE)

# illustrate reordering success using coloring

scpcp(eco[, 13:16], sel = "data[,1]", sel.palette = "d")

plot of chunk unnamed-chunk-11

# the same, but after reordering

scpcp(optile(eco[, 13:16]), sel = "data[,1]", sel.palette = "d", col.opt = list(border = alpha(1, 
    0.1)))

plot of chunk unnamed-chunk-12

# car classes (lower to upper class)

eco$Klasse <- factor(eco$Klasse, levels = levels(eco$Klasse)[c(3, 1, 2, 7, 4, 
    5, 6)])
scpcp(eco[, 17:20], sel = eco$Klasse, sel.palette = "s", col.opt = list(h = 140))

plot of chunk unnamed-chunk-14

scpcp(eco[, c(3, 17:20)], sel = eco$Klasse, sel.palette = "s", col.opt = list(h = 140), 
    lab.opt = list(abbr = 5))

plot of chunk unnamed-chunk-15