tpPar: Get or set default parameters for the package.

Description Usage Arguments Details Value See Also

View source: R/aa01-ternaryplot-options.R


Get or set default parameters for the package. Notice changes done to the parameter values are reset everytime the R session is closed and the package is reloaded.


tpPar(par = NULL, reset = FALSE, testRange, testSum, fracSumTol, vertices,
  classes, scale, okClock, sp, onFailure, ticksAt, ticksShift, arrowsShift,
  arrowsHeight, arrowsCoords, arrowsBreak, grid.line.col, axis.line.lwd,



Three possible cases:

  • If par is NULL (default): All the actual value of the parameters will be silently returned.

  • If par is a vector of character strings representing parameter names. The value of the parameters named here will be (silently) returned.

  • If par is a list following the format tag = value, where tag is the name of the parameter to be changed, and value is its new value. Such a list is returned by tpPar(). Notice that parameters can also be set indivudually, using the options listed below.


Single logical. If TRUE, all the parameters will be set to their default value. Values are reset before any change to the parameter values, as listed below.


Single logical. Test if the range of fraction is between 0 and the expected sum of fractions (1 or 100).


Single logical. Test if the sum of the 3 fractions is equal to the expected sum of fractions (1 or 100).


Single numeric. Tolerance on the sum of the 3 ternary fractions. Overall tolerance is fracSum * fracSumTol, where fracSum is the expected sum of the 3 ternary fractions. See createTernaryGeometry or createTernarySystem.


Vertices of a ternary classification (default): a data.frame with 4 columns id, bo, le and ri, as the identifier and the the 3 fractions (bottom, left, right) of the vertices. Each row is a vertex.


Polygons (classes outline) of a ternary classification (default): a data.frame with 3 columns abbrev, name and verticesId, as the abbreviation, name and identifier of the vertices of each class. Notice that verticesId must be a list of vectors, each containing the vertices that define the polygon. You can use list() to preserve the list format when defining the data.frame. For example data.frame( "abbrev" = "A", "name" = "Aa", "verticesId" = I( list( 1:3 ) ) )


Scale-extent of a ternary classification (default): a data.frame with 3 columns bo, le and ri, and 2 rows (min and max), as the min and max of the 3 fractions to be displayed (bottom, left, right).


A list of vectors of 3 logical values, with the valid blrClock geometries.


Single logical value. If TRUE, the low-level graphic functions output a Spatial* object of the graphical element that can be reused in later calculations with sp. If FALSE, simply returns a data.frame with the x-y coordinates of the graphical element.


R function. Function that should be used by ternaryCheck (and related methods)


Vector of numeric. Pre-defined position of the tick-marks for the 3 axis. Between 0 and 'fracSum' (the sum of the 3 fractions).


Single numeric. Tick-marks 'size', expressed so that ticksShift * fracSum is the length of the tick-marks. If NA, it is calculated internally from par("tcl") and the height in of a margin line in inches, estimated using the internal function .nbMargin2diffXY().


Vector of two numeric values. Axis' arrows' shift from their axis, expressed so that arrowsShift * fracSum is the start and end point. If NA, the arrow shift from their axis will be calculated from par("mgp")[ 1L ] and arrowsHeight (below).


Single numeric values. Axis' arrows' height (distance between the 1st part of the arrow and the 2nd part of the arrow), expressed in fraction of margin-lines-height (same as par("mgp")). Only used when arrowsShift (above) is NA.


Parameters used internally to define axis-arrows location


Single logical value. If TRUE, axis-arrows are 'browken' (i.e. with the arrow starting parallel to the axis and finishing toward the axis).


Single character value representing a color. Color of the grid-lines added to a ternary plot.


Single numerical value. Line thickness for the axis-lines (including ticks and arrows)

Single character value representing a color. Fill-color of the plot region (frame). Set to NA or "transparemt" to suppress color.


The function has 3 possible, non-exclusive behaviours:

Notice that when reset=TRUE and some new parameter values are provided, the parameters are first reset, and then the new parameter values are set. If par is a list, parameters are set first according to values in par, and then according to values in the parameters listed below. This combination is not recommended, but nonetheless possible.

The actual value of the parameters is stored in (and can be retrieved from) the environment rspPars. The default value of the parameters are stored in the environment rspPars. Do not use them directly.


Returns a partial or complete list of (actual) parameter values, as a named list.

See Also


ternaryplot documentation built on May 31, 2017, 4:38 a.m.