embed.APS.dataset: embed.APS.dataset

Description Usage Arguments Details Value Author(s) Examples

View source: R/static.analysis.page.R


Embed an APS dataset


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,



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 eval.args. If a function, then the function will be called with no arguments. In that case you would control the context yourself by setting the function's environment. If path to an SVG then you would have already made the plot, and that would be used. If missing then no plot is drawn—only the table is shown.


data.frame of data. If omitted, then the return value of evaluating the plotting expression or function is used (if plot is not a character).


Caption for plot


Boolean, default TRUE. Set to FALSE to not show the sidebar (filtering, tagging). (This is passed through directly to aps.dataset.divs.)


Boolean, default TRUE. Set to FALSE to not show the data table (still available on download. (This is passed through directly to aps.dataset.divs.)


If TRUE (default) then allow zooming and panning. IF FALSE then do not allow it.


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)


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


String specifying inline style of this div or NULL (default). If NULL then and div.width is also NULL then do not specfiy any inline style. If NULL and div.width is non-NULL then create a centered div of div.width pixels wide with style="width:100px; margin:0 auto" (or whatever div.width is, instead of "100px"). If non-NULL then use the string directly as the style attribute of the div.


Number of table rows to show. Default: 10 (This is passed through directly to aps.dataset.divs.)


Charvec of extra HTML classes to include in the div. (This is embedded in a list then passed through directly to aps.dataset.divs.)


Names charvec of extra attributes to include in the div. (This is embedded in a list then passed through directly to aps.dataset.divs.)


Arguments (other than filename) to pass to the svg function. This should be a named list. In particular, consider something like list(width = 8, height=5) to change the aspect ratio.


Arguments to pass to evalq when evaluating your plot code. Ignored if plot is character or a function. Otherwise it should be a named list. Default is list(envir = parent.frame()), which means the evaluation will happen in the calling frame.


Output directory. Default: get.APS.outdir(), which is either "." or the directory of your knit2html target .html file.


Passed through to static.analysis.page (but here the default is TRUE).


Passed through to static.analysis.page. ot overwrite, outdir, or write.client


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


message("See vignette embedding.html")

AnalysisPageServer documentation built on April 28, 2020, 6:32 p.m.