ggxtabs | R Documentation |
Mosaic ggplot of xtabs object
ggxtabs(
xtab,
cell_counts = F,
stats = F,
viridis_option = "G",
border_color = "white"
)
xtab |
xtabs object of exactly two categorical variables |
cell_counts |
Display cell counts, Default: F |
stats |
Display Chisq stats in caption, Default: F |
viridis_option |
Viridis color palette, Default: 'G' |
border_color |
Color of border between cells, Default: 'white' |
Takes a table of exactly two categorical variables produced by xtabs and produces a ggplot mosaic plot
ggplot
## Not run:
if(interactive()){
ggxtabs(xtabs(~color+clarity, diamonds), viridis_option = 'H')
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.