Currently, the only supported options are vega.width,
vega.height (as pixels) and vega.embed (as a list).
knit_print.vegaspec(spec, ..., options = NULL)object to be coerced to vegaspec, a Vega/Vega-Lite specification
other arguments
list, knitr options
When knitting to an HTML-based format, the spec is rendered as normal.
When knitting to an non-html format, if the
webshot package
and PhantomJS are installed, an image will be generated instead. You
may find webshot::install_phantomjs() to be useful.
This function has potential to be developed further; it
calls vegawidget() using the options vega.width,
vega.height and vega.embed:
vega.width and vega.height are passed to vegawidget()
as width and height, respectively. These are
coerced to numeric, so it is ineffective to specify a percentage.
vega.embed is passed to vegawidget() as embed. The function
vega_embed() can be useful to set vega.embed.