bb_densityplot {billboarder} | R Documentation |
Helper for creating a density plot
Description
Helper for creating a density plot
Usage
bb_densityplot(
bb,
data,
mapping = NULL,
stacked = FALSE,
stat = "density",
fill = FALSE,
...
)
Arguments
bb |
A |
data |
A |
mapping |
Mapping of variables on the chart, see |
stacked |
Logical, create a stacked density plot. |
stat |
Stat to compute : |
fill |
Produce a conditional density estimate, this option force |
... |
Arguments passed to |
Value
A billboard
htmlwidget
object.
See Also
Examples
# With a vector
billboarder() %>%
bb_densityplot(data = rnorm(1e4))
data("diamonds", package = "ggplot2")
# density plot with one variable
billboarder() %>%
bb_densityplot(data = diamonds, x = "carat")
# Same with mapping
billboarder() %>%
bb_densityplot(diamonds, bbaes(carat))
# With a grouping variable
billboarder() %>%
bb_densityplot(data = diamonds, x = "depth", group = "cut") %>%
bb_x_axis(min = 55, max = 70)
# Same with mapping
billboarder() %>%
bb_densityplot(diamonds, bbaes(depth, group = cut)) %>%
bb_x_axis(min = 55, max = 70)
# a stacked density plot using count as statistic
bb <- billboarder() %>%
bb_densityplot(diamonds, bbaes(depth, group = cut),
stacked = TRUE, stat = "count") %>%
bb_x_axis(min = 55, max = 70)
bb
# changing order
bb %>% bb_data(order = "asc")
[Package billboarder version 0.4.1 Index]