# Set up default dimensions. Width and height are multiplied by dpi to get
# pixel dimensions.
knitr::opts_chunk$set(fig.width = 4, fig.height = 3)

To embed a ggvis plot just call ggvis:

library(ggvis)
mtcars %>% ggvis(x = ~wt, y = ~mpg) %>% layer_points()
mtcars %>% ggvis(x = ~wt, y = ~mpg) %>%
  layer_points() %>%
  layer_smooths()


rstudio/ggvis documentation built on Feb. 5, 2024, 9:13 p.m.