knitr - R htmlwidgets with reveal.js -


how can use great htmlwidgets (for example http://rstudio.github.io/leaflet/) reveal.js , rmarkdown?

this mwe (not reveal.js) works:

--- 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 ``` 

but 1 doesn't:

--- 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 ``` 

i re-used example htmlwidgets-webpage, , reveal.js-template https://github.com/jjallaire/revealjs

to use reveal.js need specify framework , extension widgets in header. make sure have newest version of slidify , htmlwidgets.

--- title       : titley title titler subtitle    : subtitileir author      : author authoria job         : jobby job, cjj framework   : revealjs        # {io2012, html5slides, shower, dzslides, ...} highlighter : highlight.js  # {highlight.js, prettify, highlight} hitheme     : github      #  widgets     : []            # {mathjax, quiz, bootstrap} mode        : selfcontained # {standalone, draft} knit        : slidify::knit2slides ext_widgets: {rcharts: "libraries/highcharts"} revealjs:   theme: simple ---   ### title-y title titler    tu-title space title  \- author authorio  ---  

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -