Description Usage Arguments Value Examples
Take a plot expression or object and turn it into a base64 encoded png string for embedding in a browser
1 2 |
plotObj |
a lattice or ggplot object, or an expression of R base plotting commands |
type |
the type of plot to create (currently png or pdf) |
width |
width of plot, in pixels |
height |
width of plot, in pixels |
res |
nominal resolution in ppi which will be recorded in the file, if a positive integer |
... |
arguments passed to |
a base64 encoded png string
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | cardoonPlot(expression(plot(1:10)))
myPlotExpr <- expression({
plot(1:10)
abline(0, 1)
})
cardoonPlot(myPlotExpr)
# passing additional arguments to png
cardoonPlot(expression(plot(1:10)),
width = 800, height = 400, res = 150)
# using lattice:
cardoonPlot(xyplot(rnorm(10) ~ rnorm(10)))
# pass lattice object
p <- dotplot(variety ~ yield | year * site, data=barley)
cardoonPlot(p)
# using ggplot
cardoonPlot(qplot(mpg, wt, data = mtcars))
# pass ggplot object
p <- qplot(mpg, wt, data = mtcars)
cardoonPlot(p)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.