Created
June 4, 2020 13:38
-
-
Save riinuots/dbbd3d473abb3628a0986fba5e517738 to your computer and use it in GitHub Desktop.
SlickR slider of two ggplots, based on https://cran.r-project.org/web/packages/slickR/vignettes/plots.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
output: html_document | |
--- | |
```{r setup, include=FALSE} | |
knitr::opts_chunk$set(echo = TRUE) | |
``` | |
```{r message=FALSE, warning=FALSE} | |
library(tidyverse) | |
library(svglite) | |
library(slickR) | |
p1 = ggplot(iris, aes(x = Species, y = Sepal.Length)) + geom_point() | |
p2 = ggplot(iris, aes(x = Species, y = Sepal.Width)) + geom_point() | |
p1 = xmlSVG({show(p1)}, standalone = TRUE, height = 4, width = 4) | |
p2 = xmlSVG({show(p2)}, standalone = TRUE, height = 4, width = 4) | |
slickR(list(p1, p2), height = 400) + settings(dots = TRUE, autoplay = TRUE) | |
``` | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment