[R] question about mosaicplot and/or mosaic
Dimitri Liakhovitski
dimitri.liakhovitski at gmail.com
Thu Jul 21 18:57:12 CEST 2011
Hello!
I am trying to build a mosaic plot that has different colors for each
entry (cell). My data that goes into the plot is NOT really a
contingency table and I would like each shape to have its own
color.Looks like mosaic and mosaicplot treat the data as a contingency
table and seem to allow different columns by "variable" only. Or am I
mistaken?
For example:
library(stat)
mosaicplot(matrix(c(58, 15, 9, 13, 5,0), 3, 2),
main="",xlab="Share 0 to 100%",ylab="Share 0 to 100%",color=c(3,2))
or:
library(vcd)
mosaic(matrix(c(58, 15, 9, 13, 5,0), 3, 2),
highlighting=1,highlighting_fill=c(3,2))
Thank you!
--
Dimitri Liakhovitski
marketfusionanalytics.com
More information about the R-help
mailing list