geom_mosaic_jitter {ggmosaic} | R Documentation |
Jittered dots in Mosaic plots.
Description
A mosaic plat with jittered dots
Usage
geom_mosaic_jitter(
mapping = NULL,
data = NULL,
stat = "mosaic_jitter",
position = "identity",
na.rm = FALSE,
divider = mosaic(),
offset = 0.01,
drop_level = FALSE,
show.legend = NA,
inherit.aes = FALSE,
...
)
stat_mosaic_jitter(
mapping = NULL,
data = NULL,
geom = "mosaic_jitter",
position = "identity",
na.rm = FALSE,
divider = mosaic(),
show.legend = NA,
inherit.aes = TRUE,
offset = 0.01,
drop_level = FALSE,
...
)
Arguments
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. There are three options: If A A |
stat |
The statistical transformation to use on the data for this layer, as a string. |
position |
Position adjustment, either as a string, or the result of a call to a position adjustment function. |
na.rm |
If |
divider |
Divider function. The default divider function is mosaic() which will use spines in alternating directions. The four options for partitioning:
|
offset |
Set the space between the first spine |
drop_level |
Generate points for the max - 1 level |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
... |
other arguments passed on to |
geom |
The geometric object to use display the data |
Computed variables
- xmin
location of bottom left corner
- xmax
location of bottom right corner
- ymin
location of top left corner
- ymax
location of top right corner
Examples
data(titanic)
ggplot(data = titanic) +
geom_mosaic(aes(x = product(Class), fill = Survived), alpha = 0.3) +
geom_mosaic_jitter(aes(x = product(Class), color = Survived))
ggplot(data = titanic) +
geom_mosaic(aes(x = product(Class)), alpha = 0.1) +
geom_mosaic_jitter(aes(x = product(Class), color = Survived), drop_level = TRUE)
ggplot(data = titanic) +
geom_mosaic(alpha = 0.3, aes(x = product(Class, Sex), fill = Survived),
divider = c("vspine", "hspine", "hspine")) +
geom_mosaic_jitter(aes(x = product(Class, Sex), color = Survived),
divider = c("vspine", "hspine", "hspine"))
ggplot(data = titanic) +
geom_mosaic(alpha = 0.3, aes(x = product(Class), conds = product(Sex), fill = Survived),
divider = c("vspine", "hspine", "hspine")) +
geom_mosaic_jitter(aes(x = product(Class), conds = product(Sex), fill = Survived),
divider = c("vspine", "hspine", "hspine"))