Helper for creating a density plot
Helper for creating a density plot
bb_densityplot( bb, data, mapping = NULL, stacked = FALSE, stat = "density", fill = FALSE, ... )
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 |
A billboard
htmlwidget
object.
# 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")
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.