mosaic2 | R Documentation |
Mosaic Plot
mosaic2(tab, mt, dig = 4, resid = TRUE)
tab |
Data table |
mt |
Graph title |
dig |
Number of digits below the decimal point, Default: 4 |
resid |
Display Pearson residuals? Default: TRUE |
Object from chisq.test()
require(vcd) x = c(39,18,12,31,14, 35,23,18,35,13, 27,16,17,24,8, 9,12,8,19,22) x = matrix(x, nrow=4, ncol=5, byrow=TRUE) Subject = c("Kor", "Eng", "Math", "Etc") Hope = c("Sam", "Pub", "Exp", "Sal", "Etc") t1 = as.table(x) dimnames(t1) = list(Subject=Subject, Hope=Hope) win.graph(7, 6) mosaic2(tab=t1, mt="Students' Favorite Subject and Hope")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.