Created
July 12, 2018 13:34
-
-
Save stephlocke/1bc4b2403978abc11596395200007eb1 to your computer and use it in GitHub Desktop.
Example of trying to get an iframe of a html widget
This file contains hidden or 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
--- | |
title: "sample" | |
output: | |
md_document: | |
variant: markdown_github | |
preserve_yaml: true | |
always_allow_html: yes | |
--- | |
```{r setup, include = FALSE, message = FALSE, warning = FALSE, error = FALSE} | |
library(knitr) | |
library(htmlwidgets) | |
library(widgetframe) | |
opts_chunk$set(collapse = TRUE) | |
if(!require(outbreaks)) install.packages(outbreaks) | |
if(!require(epicontacts)) install.packages(epicontacts) | |
``` | |
```{r} | |
library(epicontacts) | |
library(outbreaks) | |
merskor15 <- make_epicontacts(linelist = mers_korea_2015$linelist, | |
contacts = mers_korea_2015$contacts, | |
directed = FALSE) | |
``` | |
```{r} | |
p=plot(merskor15) | |
``` | |
```{r echo=FALSE} | |
saveWidget(p, "htmlwidget.html", selfcontained = TRUE) | |
``` | |
<iframe src="htmlwidget.html" width="100%" height="500px"></iframe> | |
```{r echo=FALSE} | |
frameWidget(p) | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment