ggvis in an interactive document

library(knitr)
library(ggvis)
library(shiny)
library(dplyr)

An interactive plot:

cocaine %>%
  ggvis(x = ~potency) %>%
  layer_histograms(width = input_slider(1, 20, value = 5))

An interactive table:

cocaine %>%
  group_by(state) %>%
  summarise(potency = mean(potency), weight = mean(weight)) %>%
  renderDataTable()


Try the ggvis package in your browser

Any scripts or data that you put into this service are public.

ggvis documentation built on March 31, 2023, 7:13 p.m.