[R] Mosaicplot with different colors

From: Jan Sabee <jan.sabee_at_gmail.com>
Date: Wed 30 Mar 2005 - 07:35:43 EST


This dataset below is one sample answer the questioner from our customer.

> testbank <- read.table("testbank.txt", header=T)
> testbank

     age married income gender ownhouse class
1  20-30      no   high female      yes   1st
2  30-40      no   high female      yes   1st
3  40-50      no    low female      yes   1st
4  50-60      no   high female      yes   1st
5  60-70      no   high female      yes   1st
6  20-30      no   high female      yes   1st
7  20-30      no medium female      yes   1st
8  20-30      no    low female      yes   1st
9  20-30      no   high   male      yes   1st
10 20-30      no   high female      yes   1st
11 30-40      no   high female      yes   1st
12 40-50      no   high female      yes   1st
13 50-60      no medium female      yes   1st
14 20-30      no medium female      yes   1st
15 20-30      no    low female      yes   1st
16 20-30      no   high   male      yes   1st

> testbank.tab <- table(testbank)
> library(vcd)
> mosaicplot(testbank.tab)
> mosaicplot(testbank.tab, shade=T)

I know mosaicplot (package vcd) can handle for this dataset. I want to plot that dataset which different colors for age, income and gender. How can I do that? Or are there any others package? Thanks in advance for any assistance.

Jan Sabee



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Mar 30 07:45:29 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:57 EST