ggvis
package by Hadley WickhamThis is a demo of ggvis
. * The ggvis API is currently rapidly evolving. The authors of the package strongly recommend that you do not rely on this for production
Install the latest release version from CRAN with: install.packages("ggvis")
Install the latest development version with: devtools::install_github("rstudio/ggvis")
library(ggvis)
mtcars %>%
ggvis(~mpg, ~disp) %>%
layer_points() %>%
set_options(height = 300, width = 400)
mtcars %>%
ggvis(~mpg, ~disp, fill = ~vs) %>%
layer_points() %>%
set_options(height = 300, width = 400)
mtcars %>% ggvis(~wt, ~mpg) %>%
layer_smooths(span = 1) %>%
layer_smooths(span = 0.3, stroke := "red") %>%
set_options(height = 300, width = 400)
mtcars %>%
ggvis(~wt, ~mpg) %>%
layer_points() %>%
layer_smooths() %>%
set_options(height = 300, width = 400)
mtcars %>%
ggvis(~wt, ~mpg) %>%
layer_points() %>%
layer_model_predictions(model = "lm", se = TRUE) %>%
set_options(height = 300, width = 400)
mtcars %>%
ggvis(~wt, ~mpg) %>%
layer_points(fill = ~factor(cyl)) %>%
set_options(height = 300, width = 400)
mtcars %>%
ggvis(~wt, ~mpg, fill = ~factor(cyl)) %>%
layer_points() %>%
group_by(cyl) %>%
layer_model_predictions(model = "lm") %>%
set_options(height = 300, width = 400)
pressure %>%
ggvis(~temperature, ~pressure, fill := 'green') %>%
layer_bars(width = 10) %>%
set_options(height = 300, width = 400)
pressure %>% ggvis(~temperature, ~pressure) %>%
layer_points(fill := 'blue') %>%
layer_lines() %>%
set_options(height = 300, width = 400)
mtcars %>%
ggvis(~factor(cyl), ~mpg) %>%
layer_boxplots(stroke = ~factor(cyl)) %>%
set_options(height = 300, width = 400)
## Warning in rbind_all(out[[1]]): Unequal factor levels: coercing to
## character