| encodePlotAs | R Documentation |
The result can be set as the src attribute of an <img>
element in HTML.
encodePlotAs(format, plotFn)
format |
An object specifying the output, with the following members:
format$type is |
plotFn |
Function to call to perform the plot |
You will not need to call this function unless you want to return more
than one plot per call, as the last plot produced will be returned
in the plot property of the result from shinylight.call
anyway.
list with two keys, whose values can each be NULL:
'plot' is a plot in HTML img src form and 'data' is a
data frame or other non-plot result.
A list with an element named plot containing the
plot encoded as required either for an HTML image element's
src attribute, or a element's href attribute.
If the function returns a matrix or data frame, this will be returned
in the list's data element.
rrpcServer
pdf <- encodePlotAs(list(type="pdf", width=7, height=8), function() {
barplot(c(1, 2, 3, 4))
})
grDevices::png() # workaround; you do not have to do this
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.