Description Usage Arguments Value Examples
View source: R/compute_density.R
Compute density of data.
1 2 |
x |
Dataset (data frame, |
x_var,w_var |
Names of variables to use for x position, and for weights. |
kernel |
Smoothing kernel. See |
trim |
If |
n |
Number of points (along x) to use in the density estimate. |
na.rm |
If |
... |
Additional arguments passed on to |
A data frame with columns:
pred_ |
regularly spaced grid of |
resp_ |
density estimate |
1 2 3 4 | mtcars %>% compute_density(~mpg, n = 5)
mtcars %>% group_by(cyl) %>% compute_density(~mpg, n = 5)
mtcars %>% ggvis(~mpg) %>% compute_density(~mpg, n = 5) %>%
layer_points(~pred_, ~resp_)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.