ggally_count | R Documentation |
Plot the number of observations by using rectangles with proportional areas.
ggally_count(data, mapping, ...)
ggally_countDiag(data, mapping, ...)
data |
data set using |
mapping |
aesthetics being used |
... |
other arguments passed to |
You can adjust the size of rectangles with the x.width
argument.
Joseph Larmarange
# Small function to display plots only if it's interactive
p_ <- GGally::print_if_interactive
data(tips)
p_(ggally_count(tips, mapping = ggplot2::aes(x = smoker, y = sex)))
p_(ggally_count(tips, mapping = ggplot2::aes(x = smoker, y = sex, fill = day)))
p_(ggally_count(
as.data.frame(Titanic),
mapping = ggplot2::aes(x = Class, y = Survived, weight = Freq)
))
p_(ggally_count(
as.data.frame(Titanic),
mapping = ggplot2::aes(x = Class, y = Survived, weight = Freq),
x.width = 0.5
))
# Small function to display plots only if it's interactive
p_ <- GGally::print_if_interactive
p_(ggally_countDiag(tips, mapping = ggplot2::aes(x = smoker)))
p_(ggally_countDiag(tips, mapping = ggplot2::aes(x = smoker, fill = sex)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.