rmarkdown.helpers
packageCollection of helpers for rmarkdown.
devtools::install_github('kjedrzejewski/rmarkdown.helpers')
embed_htmlwidget(widget, rasterise = F)
Converts htmlwidgets to a form that may be correctly embedded in the output document, depending on its type.
Requires webshot
and EBImage
packages.
You may install webshot
using following code:
devtools::install_github("wch/webshot")
webshot::install_phantomjs() # Not required if you have PhantomJS already installed in your system
You may install EBImage
using following code:
source("https://bioconductor.org/biocLite.R")
biocLite("EBImage")
Example
library(htmlwidgets)
library(wordcloud2)
w = wordcloud2(demoFreq, size = 1, shape = 'star')
embed_htmlwidget(w, rasterise = T)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.