ggally_ratio | R Documentation |
Plots the mosaic plot by using fluctuation.
ggally_ratio(
data,
mapping = ggplot2::aes(!!!stats::setNames(lapply(colnames(data)[1:2], as.name), c("x",
"y"))),
...,
floor = 0,
ceiling = NULL
)
data |
data set using |
mapping |
aesthetics being used. Only x and y will used and both are required |
... |
passed to |
floor |
don't display cells smaller than this value |
ceiling |
max value to scale frequencies. If any frequency is larger than the ceiling, the fill color is displayed darker than other rectangles |
Barret Schloerke
# Small function to display plots only if it's interactive
p_ <- GGally::print_if_interactive
data(tips)
p_(ggally_ratio(tips, ggplot2::aes(sex, day)))
p_(ggally_ratio(tips, ggplot2::aes(sex, day)) + ggplot2::coord_equal())
# only plot tiles greater or equal to 20 and scale to a max of 50
p_(ggally_ratio(
tips, ggplot2::aes(sex, day),
floor = 20, ceiling = 50
) + ggplot2::theme(aspect.ratio = 4 / 2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.