mosaic
from the vcd package
crosstabplot(data, rowvar, colvar, varnames, title = NULL, subtitle = NULL, label = FALSE, shade = TRUE, ...)
crosstabs
e.g. digitsmosaic
which this function wraps
crosstabs
which does the data manipulation for the crosstab
df <- data.frame(cbind(x=seq(1,3,by=1), y=sample(LETTERS[6:8],60,replace=TRUE)),
fac=sample(LETTERS[1:4], 60, replace=TRUE))
varnames<-c('Quality','Grade')
myCT <- crosstabs(df, rowvar = "x",colvar = "fac", varnames = varnames, digits =2)
crosstabplot(df, rowvar = "x",colvar = "fac", varnames = varnames,
title = 'My Plot', subtitle = 'Foo', label = FALSE, shade = TRUE, digits = 3)
Run the code above in your browser using DataLab