Nothing
# A. Understand data; library(vcd) has more options for mosaic plots
setwd("C:/aErer")
Titanic; as.data.frame(Titanic)
str(Titanic)
ftable(Titanic)
# B. Draw a mosaic plot for two categorical variables
windows(width = 5.3, height = 2.5, pointsize = 9)
bringToTop(stay = TRUE)
par(mai = c(0.4, 0.4, 0.1, 0))
mosaicplot(formula = ~ Class + Survived, data = Titanic,
color = c("red", "green"), main = "", cex.axis = 1)
showMosaic <- recordPlot()
# C. Save the graph on a file device
pdf(file = "fig_showMosaic.pdf", width = 5.3, height = 2.5)
replayPlot(showMosaic)
dev.off()
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.