Learn R Programming

expirest (version 0.1.6)

set_limits: Adjustment of limits

Description

The function set_limits() adjusts the limits according to the number of relevant decimal places and according to the transformation requirement.

Usage

set_limits(
  rl,
  rl_sf,
  sl,
  sl_sf,
  sf_option = "tight",
  xform = c("no", "no"),
  shift = c(0, 0),
  ivl_side = "lower"
)

Value

A list with the following elements is returned:

sf.option

A character string that specifies the option concerning the significant figures.

xform

A vector of two character strings that specifies the transformation of the response and the time variable.

shift

A vector of two values to be added to the values of the transformed \(x\) and/or \(y\) variables (specified via the xform parameter).

rl.orig

A numeric value or a numeric vector of the release limit(s) on the original scale. If NA was passed in, NA is returned.

rl.sf

A numeric value or a numeric vector that specifies the significant figures of the release limit(s). If NA was passed in, NA is returned.

rl

A numeric value or a numeric vector of the adjusted (as specified by the sf_option parameter) release limit(s). If NA was passed in, NA is returned.

rl.trfmd

A numeric value or a numeric vector of the adjusted and transformed, if applicable (as specified by the the sf_option parameter and the second element of the xform parameter, respectively), release limit(s), otherwise the same as rl.

sl.orig

A numeric value or a numeric vector of length 2 of the specification limit(s) on the original scale.

sl.sf

A numeric value or a numeric vector of length 2 that specifies the significant figures of the specification limit(s).

sl

A numeric value or a numeric vector of length 2 of the adjusted (as specified by the sf_option parameter) specification limit(s).

sl.trfmd

A numeric value or a numeric vector of length 2 of the adjusted and transformed, if applicable (as specified by the the sf_option parameter and the second element of the xform parameter, respectively) specification limit(s), otherwise the same as sl.

Arguments

sl

A numeric value or a numeric vector of length 2 that specifies the specification limit or limits. If a vector is provided it must be of the form c(lower limit, upper limit).

sl_sf

A positive integer or a vector of positive integers that specifies the number of “significant figures” (sf) of sl. It must have the same length as sl.

sf_option

A character string that specifies if the limits (rl or sl) should be regarded as “tight” or “loose”, i.e. either "tight" or "loose", respectively. The default is "tight". The option "tight" means that the limits are rounded to the number of significant digits specified by the parameters rl_sf and sl_sf. If sf_option = "loose", four on the order of the last significant digit + 1 is added if ivl_side = "upper" or five on the order of the last significant digit + 1 is subtracted if ivl_side = "upper".

xform

A vector of two character strings that specifies the transformation of the response and the time variable. The default is “no” transformation, i.e. c("no", "no"), where the first element specifies the transformation of the \(x\) variable and the second element the transformation of the \(y\) variable. Valid alternatives for \(x\) and/or \(y\) variable transformation are "log" (natural logarithm), "sqrt" (square root) and "sq" (square).

shift

A vector of two values which will be added to the variables \(x\) and/or \(y\) before they are transformed as specified by the xform parameter, where the first element will be added to the \(x\) variable and the second element to the \(y\) variable. The purpose is to prevent an undefined state which could arise when variables with values of \(\leq 0\) are log or square root transformed. The default is c(0, 0).

ivl_side

A character string that specifies if the specification limit, given that the limit has only one side, is an “upper” or a “lower” bound, i.e. it is specified as either "upper" or "lower", respectively. The default is "lower". If the specification has two boundaries, then this parameter specifies the preferred side. If no side is preferred over the other, "both" can be used.

Details

The function set_limits() adjusts the limits according to rl_sf and sl_sf and, if necessary, transforms the limits (rl and sl) as specified by the parameters xform and shift.

See Also

expirest_osle, expirest_wisle.