Description Usage Arguments See Also Examples
Display binned data
1 2 3 4 5 |
vis |
Visualisation to modify |
... |
Visual properties used to override defaults. |
width |
The width of the bins. The default is |
center |
The center of one of the bins. Note that if center is above or below
the range of the data, things will be shifted by an appropriate number of |
boundary |
A boundary between two bins. As with |
closed |
One of |
stack |
If |
layer_bars
For bar graphs of counts at each unique
x value, in contrast to a histogram's bins along x ranges.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # Create histograms and frequency polygons with layers
mtcars %>% ggvis(~mpg) %>% layer_histograms()
mtcars %>% ggvis(~mpg) %>% layer_histograms(width = 2)
mtcars %>% ggvis(~mpg) %>% layer_freqpolys(width = 2)
# These are equivalent to combining compute_bin with the corresponding
# mark
mtcars %>% compute_bin(~mpg) %>% ggvis(~x_, ~count_) %>% layer_paths()
# With grouping
mtcars %>% ggvis(~mpg, fill = ~factor(cyl)) %>% group_by(cyl) %>%
layer_histograms(width = 2)
mtcars %>% ggvis(~mpg, stroke = ~factor(cyl)) %>% group_by(cyl) %>%
layer_freqpolys(width = 2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.