我该如何在reveal.js和Rmarkdown中使用htmlwidgets(例如http://rstudio.github.io/leaflet/)?这个非reveal.js的最小工作示例可以正常运行:
---
title: "Maptest 1"
output: html_document
---
## Map
```{r, echo=FALSE}
library(leaflet)
m <- leaflet()
m <- addTiles(m)
m <- addMarkers(m, lng=174.768, lat=-36.852, popup="The birthplace of R")
m
```
但是这个不行:
---
title: "Maptest 2"
output: revealjs::revealjs_presentation
---
## Map
```{r, echo=FALSE}
library(leaflet)
m <- leaflet()
m <- addTiles(m)
m <- addMarkers(m, lng=174.768, lat=-36.852, popup="The birthplace of R")
m
```
我重新使用了来自htmlwidgets网页的例子,而reveal.js模板来自于https://github.com/jjallaire/revealjs