data(Vietnam)
str(Vietnam)
# make it into a table
Vietnam.table <- xtabs(Freq ~ sex+yr+resp, data=Vietnam)
structable(Vietnam.table)
# mosaic plots for mutual independence
mosaic(Vietnam.table, shade=TRUE)
mosaic(Vietnam.table, gp=shading_Friendly)Run the code above in your browser using DataLab