# NOT RUN {
data(immigration)
# identify all levels
cj_table(immigration, ~ Gender + Education + LanguageSkills)
cj_table(immigration, ~ Gender + Education + LanguageSkills, include_ref = TRUE)
# display frequencies
(f <- cj_freqs(immigration, ~ Gender + Education + LanguageSkills, id = ~ CaseID))
# restrictions
## check display proportions
cj_props(immigration, ~ Job, id = ~ CaseID)
## check which combinations were not allowed
subset(cj_props(immigration, ~ Job + Education, id = ~ CaseID), Proportion == 0)
# }
# NOT RUN {
# plotting
(p <- plot(f))
## change ggplot2 theme
p + ggplot2::theme_bw()
## monochrome bars
p + ggplot2::scale_fill_manual(values = rep("black", 9)) +
ggplot2::theme(legend.position = "none")
# }
Run the code above in your browser using DataLab