【发布时间】:2015-06-15 00:35:21
【问题描述】:
如何将出色的 htmlwidgets(例如 http://rstudio.github.io/leaflet/)与reveal.js 和 Rmarkdown 一起使用?
这个mwe(不是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-webpage 中的示例,reveal.js-template 来自https://github.com/jjallaire/revealjs
【问题讨论】:
标签: r knitr r-markdown reveal.js