library(ggvis)
mtcars %>%
ggvis(~cyl, ~mpg) %>%
layer_boxplots() %>%
save_spec("boxplot/boxplot-continuous.json")
mtc <- mtcars
mtc$cyl <- factor(mtc$cyl)
mtc %>%
ggvis(~cyl, ~mpg) %>%
layer_boxplots() %>%
save_spec("boxplot/boxplot-categorical.json")
dat <- data.frame(x = c('a','a','a','b','b','b'), y = c(1:3, 2:4))
dat %>%
ggvis(x = ~x, y = ~y) %>%
layer_boxplots() %>%
save_spec("boxplot/boxplot-no-outliers.json")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.