static.analysis.page: static.analysis.page

Description Usage Arguments Details Value Author(s) Examples

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

Description

Create interactive AnalysisPage plots from static data

Usage

1
2
3
4
5
6
7
8
static.analysis.page(outdir, svg.files, dfs, titles, show.xy = FALSE,
  use.rownames.for.ids = FALSE, check.rowname.case = TRUE,
  check.html4.ids = TRUE, group.length.vecs = NULL, signif.digits = 3,
  verbose = FALSE, overwrite = FALSE, write.client = TRUE,
  client.basedir = system.file("htdocs/client/dist-apss", package =
  "AnalysisPageServer"), app.html = "analysis-page-server-static.html",
  build.full.url = write.client, data.subdir = if (write.client) "data" else
  ".", randomize.filename = FALSE)

Arguments

outdir

Base directory for output files. Will be created if it does not already exist (however, its parent directory must already exist).

svg.files

Character vector of paths to SVG files. NAs can be used as placeholders for datasets that have data but no plot. Length must be at least 1. If omitted then all NAs are used, something like rep(NA, length(dfs)), but a bit more careful about corner cases and types. (So you have to provide at least one of svg.files and dfs).

dfs

List of data frames of the same length as svg.files or, if length(svg.files) == 1, a single data.frame. NULLs can be used as placeholders for datasets that have plot but no data, but an error is thrown if the corresponding entry in svg.files is also NA. If omitted then all NULLss are used. (So you have to provide at least one of svg.files and dfs). Note that for dfs we use NULLs since it is a list but for svg.files we use NAs since it is a vector and you can't hold a place in a vector with NULL.

titles

A character vector of titles of the same length as svg.files to display above each plot. Default is rep("", length(svg.files)).

show.xy

Logical. If FALSE (default) then the first two columns of your data (the x and y coordinates) are used to annotate the plot but not actually exposed to the user in the table or on rollover. If TRUE then they are exposed. Recycled to length(svg.files).

use.rownames.for.ids

Logical, default FALSE. The default behavior is to generate and assign unique IDs to each point. This makes it impossible to tag two elements in the same plot, or even in different plots with the same ID. If you set this to TRUE then your rownames are used. This means that if you are not careful you might accidentally couple between multiple datasets on the page! Recycled to length of svg.files, so you can set it for each data set independently if you so choose.

check.rowname.case

Logical, default TRUE. For data frames with use.rownames.for.ids TRUE a check is made that there are not two rownames that are equal without case senstitivity but not with (such as "FirstRow" and "firstrow"). If any is found then an error is thrown. This could possibly be a problem with some browsers, which might treat them the same. FALSE means to skip this check.

check.html4.ids

Logical, default TRUE. For data frames with use.rownames.for.ids TRUE a check is made that rownames are valid HTML4 IDs: begin with a letter ([A-Za-z]), then followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods ("."). (Taken from http://www.w3.org/TR/html4/types.html#h-6.2) FALSE means to skip this check and try to use whatever IDs are there.

group.length.vecs

List of integer vectors or NULLs of the same length as svg.files (or a single vector or NULL if length(svg.files) == 1). If non-NULL, each one is passed through to annotate.analysis.page.svg as the group.lengths argument, which allows you to specify that the elements might be organized into multiple non-contiguous groups, for example separate panels. A single NULL is recycled to length.

signif.digits

Passed through to annotate.data.frame. The number of significant digits to which non-integer numeric fields should be rounded.

verbose

Boolean, default FALSE. If TRUE then message() will be used for progress updates.

overwrite

If FALSE (default) then an error is thrown if the base directory is not empty. If TRUE then files will be added to the directory, possibly overwriting existing files of the same name.

write.client

Boolean, default TRUE. Should I write the HTML/Javascript/CSS files necessary for the client, or just write the data files. The default is to write everything necessary. Use FALSE if you want to have only a single instance of the client files and only write data and plots with this function.

client.basedir

Path to client files. Default: system.file("htdocs/client/dist-apss", package = "AnalysisPageServer"). Probably should not be modified except during development work on the client.

app.html

Path to application .html file, relative to client.basedir. Default: "analysis-page-server-static.html".

build.full.url

Boolean, default is the same as write.client. For the return value build a full URL starting with "file://", using the full (normalized) path to output directory and index.html, then the full query string. If FALSE then just return the query string.

data.subdir

Subdirectory of outdir which will hold the data files. Special value of "." means to put them in outdir itself and not create a subdirectory. Default: "data" if write.client is TRUE and "." if it is FALSE.

randomize.filename

Boolean, default FALSE. Should I add some random characters to the names of the plot and dataset files? Sometimes web browsers do not refresh these files properly and so adding these random characters can overcome these stubborn cache issues.

Details

Create interactive AnalysisPage plots from static data. An index.html file will be created which, when opened, will have all the data and interactivity.

Also in that subdirectory there will be other HTML and Javascript files as necessary.

Finally, your SVGs and data will be stored in subdirectories.

The first two columns of the data frame should be x and y coordinates of the points (or regions) in the plot that you want to associate with the rows of the data frame.

Value

List with two components. First is $URL, which is the URL to index.html file, or, if build.full.url = FALSE then just the query string. and second is $paths.list, which lists the paths to all of the written plot and data files, in the format described in link{static.analysis.page.query.string} (and suitable for passing to that function as the parameter of the same name).

Author(s)

Brad Friedman

Examples

1
message("See vignette StaticContent.html")

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