Description Usage Arguments Details Value Author(s) Examples
View source: R/static.analysis.page.R
Embed an APS dataset
1 2 3 4 5 6 | embed.APS.dataset(plot, df, title, show.sidebar = TRUE, show.table = TRUE,
allow.zoom = TRUE, plot.height = NULL, div.width = NULL, style = NULL,
num.table.rows = 10, extra.html.classes = character(),
extra.div.attr = character(), svg.args = list(), eval.args = list(envir
= parent.frame()), outdir = get.APS.outdir(), randomize.filename = TRUE,
...)
|
plot |
If present, then either an expression, a function, or a path to SVG file (not yet annotated).
If an then the expression will be evaluated after opening
a plotting device. The expression
will be evaluated in the calling frame, so your local variables will be
accessible, but this can be changed by modifying |
df |
data.frame of data. If omitted, then the return value
of evaluating the plotting expression or function is used (if |
title |
Caption for plot |
show.sidebar |
Boolean, default TRUE. Set to FALSE to not show the
sidebar (filtering, tagging). (This is passed through directly to
|
show.table |
Boolean, default TRUE. Set to FALSE to not show the data
table (still available on download.
(This is passed through directly to
|
allow.zoom |
If TRUE (default) then allow zooming and panning. IF FALSE then do not allow it. |
plot.height |
If NULL (default) then do not specify 'data-plot-height' attribute. Otherwise, use this number as 'data-plot-height' attribute, which will specify the plot height (in pixels) |
div.width |
If NULL (default) then do not specify div width in style. Otherwise, supply a valid CSS width (e.g. "200px" or "60 and this will be rolled into the inline-style |
style |
String specifying inline style of this div or NULL (default).
If NULL then and |
num.table.rows |
Number of table rows to show. Default: 10
(This is passed through directly to
|
extra.html.classes |
Charvec of extra HTML classes to include in the
div. (This is embedded in a list then passed through directly to
|
extra.div.attr |
Names charvec of extra attributes to include in the div.
(This is embedded in a list then passed through directly to
|
svg.args |
Arguments (other than filename) to pass to the |
eval.args |
Arguments to pass to |
outdir |
Output directory. Default: |
randomize.filename |
Passed through to |
... |
Passed through to |
This function is meant to be called in a knitr document
that is being knit with knit2html
. It
makes a few assumptions that are valid in that context.
It makes a call to static.analysis.page
for you
to annotate and write the SVG and JSON files, then emits
the <div>
element to STDOUT. outdir
defaults to ".".
It only does one plot/dataset at a time.
Returns the div, invisibly.
Brad Friedman
1 | message("See vignette embedding.html")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.