Desc(table(d.pizza$driver, Weekday(d.pizza$date)), rfrq="100", plotit=TRUE)
tab <- as.matrix(read.table(text="549 212 54
93 124 54
233 78 33
119 42 13
225 41 46
455 12 7
402 132 153"
))
tab
# taciturn ("Ripley style")
Desc(tab, verbose="low")
# talkative
Desc(tab, verbose="high", expected=TRUE, res=TRUE)
# higher dimensional tables
Desc(Titanic)
# use global format options for presentation
options(fmt.abs=structure(list(digits=0, big.mark=""), class="fmt"))
options(fmt.per=structure(list(digits=2, fmt="%"), class="fmt"))
Desc(area ~ driver, d.pizza, plotit=FALSE)
options(fmt.abs=structure(list(digits=0, big.mark="'"), class="fmt"))
options(fmt.per=structure(list(digits=3, leading="drop"), class="fmt"))
Desc(area ~ driver, d.pizza, plotit=FALSE)
# get more flexibility, create the table first
tab <- as.table(apply(HairEyeColor, c(1,2), sum))
tab <- tab[,c("Brown","Hazel","Green","Blue")]
# diplay only absolute values, row and columnwise percentages
Desc(tab, row.vars=c(3, 1), rfrq="011", plotit=FALSE)
# do the plot by hand, while setting the colours for the mosaics
cols1 <- SetAlpha(c("sienna4", "burlywood", "chartreuse3", "slategray1"), 0.6)
cols2 <- SetAlpha(c("moccasin", "salmon1", "wheat3", "gray32"), 0.8)
PlotDesc(tab, col1=cols1, col2=cols2)
Run the code above in your browser using DataLab