embed_htmlwidget: Embeds widget in the rmarkdown document.

Description Usage Arguments Value Author(s) Examples

Description

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()

You may install 'EBImage' using following code: source("https://bioconductor.org/biocLite.R")
biocLite("EBImage")

Usage

1
embed_htmlwidget(widget, rasterise = F)

Arguments

widget

A htmlwidget to be embedded.

rasterise

Whether the widget should be rasterised, even if it may be included in the interactive form. Maybe useful when given widget isn't properly embedded in document types it should be.

Value

Htmlwidget given as paramater or no value (but the widget is transformed correctly to be embedded in the PDF document).

Author(s)

Krzysztof Jedrzejewski <kjedrz@gmail.com>

Examples

1
2
3
4
library(htmlwidgets)
library(wordcloud2)
w = wordcloud2(demoFreq, size = 1, shape = 'star')
embed_htmlwidget(w)

kjedrzejewski/rmarkdown.helpers documentation built on May 20, 2019, 10:25 a.m.