This 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

Scatter Plots

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)

Combo Plot

mtcars %>% ggvis(~wt, ~mpg) %>%
  layer_smooths(span = 1) %>%
  layer_smooths(span = 0.3, stroke := "red") %>%
  set_options(height = 300, width = 400)

Regression Line

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)

Scatter plots with grouping

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)

Bar Plots

pressure %>% 
  ggvis(~temperature, ~pressure, fill := 'green') %>%
  layer_bars(width = 10) %>%
  set_options(height = 300, width = 400)

Line Plot

pressure %>% ggvis(~temperature, ~pressure) %>%
  layer_points(fill := 'blue') %>% 
  layer_lines() %>%
  set_options(height = 300, width = 400)

Box Plot

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

References