Skip to content

Instantly share code, notes, and snippets.

@padamson
Last active October 1, 2016 13:37
Show Gist options
  • Save padamson/db256750a58497c4a2c90457f7f84107 to your computer and use it in GitHub Desktop.
Save padamson/db256750a58497c4a2c90457f7f84107 to your computer and use it in GitHub Desktop.
Create mosaic plot for Real-World Machine Learning Figure 2.12
library(vcd)
mosaic(
~ Sex + Survived,
data = titanic,
main = "Mosaic plot for Titanic data: Gender vs. survival",
shade = TRUE,
split_vertical = TRUE,
labeling_args = list(
set_varnames = c(
Survived = "Survived?")
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment