prepanel: Prepanel Function for Trelliscope Displays

Description Usage Arguments Details Value See Also Examples

Description

Apply a prepanel function to objects of class "ddo" or "ddf" to determine ranges of x and y axis limits prior to creating a trelliscope display (makeDisplay). Useful in conjunction with setLims.

Usage

1
2
prepanel(data, prepanelFn = NULL, params = NULL, packages = NULL,
  control = NULL, verbose = TRUE)

Arguments

data

an object of class "localDiv" or "rhData"

prepanelFn

a prepanel function that returns a list specifying xlim and ylim for determining axis limits, and optionally dx and dy for determining aspect ratio (used to define slopes of line segments used for banking computations). prepanelFn can also be a panelFn (see makeDisplay) that returns either an object of class "trellis" or "ggplot", since xlim and ylim can be determined from these.

params

a named list of parameters external to the input data that are needed in the distributed computing (most should be taken care of automatically such that this is rarely necessary to specify)

packages

a vector of R package names that contain functions used in prepanelFn (most should be taken care of automatically such that this is rarely necessary to specify)

control

parameters specifying how the backend should handle things (most-likely parameters to rhwatch in RHIPE) - see rhipeControl and localDiskControl

verbose

print status messages?

Details

The plot method plots the sorted axis ranges for the x and y axis for the case of "same" (all axis limits share the same range) and "sliced" (all axis limits share the) and can be useful in helping determine how to ultimately set the limits.

You do not need to use prepanel() to ultimately create a display with makeDisplay(), but if you bypass, you will either need to specify your own limits in your plot command, or do nothing, in which case each individual plot will have limits based on the data in the split being plotted (the axes will be "free").

Axis limits are very important. What makes viewing groups of plots of subsets of data ("small multiples") so powerful is being able to make meaningful visual comparisons across plots. This is much easier to do if scales for each plot are commensurate.

This function is also useful for identifying subsets with very large outlying values, and in conjunction with setLims, allows you to account for that prior to the expensive process of creating all of the plots.

Value

object of class "trsPre". This is a list of the x and y axis ranges for each split, along with the aspect ratio banking value if dx and dy are supplied in prepanelFn. Can be used with plot.trsPre and setLims.

See Also

x plot.trsPre, setLims, makeDisplay

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
d <- datadr::divide(iris, "Species")

irisPreFn <- function(x) {
  list(
    xlim = range(x$Sepal.Length),
    ylim = range(x$Sepal.Width)
  )
}

irisPre <- prepanel(d, prepanelFn = irisPreFn)

plot(irisPre)

irisLims <- setLims(irisPre, x = "same", y = "sliced")

tesseradata/trelliscope documentation built on May 31, 2019, 8:58 a.m.