tests/specs/bar.r

# Basic bar graphs
library(ggvis)
library(dplyr, warn.conflicts = FALSE)

pressure %>%
  ggvis(~factor(temperature), ~pressure) %>%
  layer_bars(width = 0.5) %>%
  save_spec("bar/categorical-x.json")

pressure %>%
  ggvis(x = ~temperature, y = ~pressure) %>%
  layer_bars(fill:="red") %>%
  save_spec("bar/continuous-x.json")

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.