Skip to content

Instantly share code, notes, and snippets.

@yutannihilation
Created October 12, 2015 06:23
Show Gist options
  • Save yutannihilation/7d05bf4c34970258e693 to your computer and use it in GitHub Desktop.
Save yutannihilation/7d05bf4c34970258e693 to your computer and use it in GitHub Desktop.
add as.iframe option in htmlwidgets
---
title: "leaflet test"
author: "Hiroaki Yutani"
date: "`r Sys.Date()`"
output:
html_document:
as.iframe: true
---
source code of this Rmd is here: https://gist.github.com/yutannihilation/7d05bf4c34970258e693
## Install
```{r}
devtools::install_github("yutannihilation/htmlwidgets", ref="knit_print-with-iframe")
```
## No options
```{r echo=FALSE}
library(leaflet)
leaflet() %>% addTiles()
```
## ``widget.height = 300, widget.width = "50%"`
```{r echo=FALSE, widget.height = 300, widget.width = "50%"}
library(leaflet)
leaflet() %>% addTiles()
```
## ``widget.styles=list(`border`='10px solid red')``
```{r echo=FALSE, widget.styles=list(`border`='10px solid red')}
library(leaflet)
leaflet() %>% addTiles()
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment