library(knitr)
library(ggvis)
opts_chunk$set(comment = "#>", error = FALSE, tidy = FALSE)
opts_chunk$set(fig.width = 2.5, fig.height = 1.5, dpi = 100)

ggvis is a data visualization package for R which lets you:

The goal is to combine the best of R (e.g. every modelling function you can imagine) and the best of the web (everyone has a web browser). Data manipulation and transformation are done in R, and the graphics are rendered in a web browser, using Vega. For RStudio users, ggvis graphics display in a viewer panel, which is possible because RStudio is a web browser.

Examples of ggvis graphics

Histogram:

# Histogram
faithful %>% ggvis(~eruptions, fill := "#ffffdd", fill.hover := "#eebbbb") %>%
  layer_histograms(width = 0.2) %>%
  add_axis("x", title = "eruptions") %>%
  add_axis("y", title = "count")

Scatterplot with smooth curve and interactive control:

# Scatter plot with model fit line
mtcars %>%
  ggvis(~wt, ~mpg) %>%
  layer_points() %>%
  layer_smooths(span = input_slider(0.2, 1, 0.75, step = 0.05,
    label = "Smoothing span"))

Getting started with ggvis

More advanced topics

More about ggvis



rpruim/ggvis2 documentation built on May 28, 2019, 2:34 a.m.