Range: Range class.

RangeR Documentation

Range class.

Description

Range class.

Range class.

Details

A class for storing min/max range or value/tolerance.

Methods

Public methods


Method new()

Initializer.

Usage
Range$new(
  min = NULL,
  max = NULL,
  value = NULL,
  delta = NULL,
  ppm = NULL,
  tol = NULL,
  tolType = c("delta", "plain", "ppm")
)
Arguments
min

The minimum value of the range.

max

The maximum value of the range.

value

The value.

delta

The delta tolerance.

ppm

The PPM tolerance.

tol

The tolerance value, whose type (ppm or delta) is specified by the "tolType" parameter.

tolType

The type of the tolerance value specified by the "tol" parameter.

Returns

Nothing.

Examples
# Create an instance from min and max:
Range$new(min=1.2, max=1.5)

Method getValue()

Gets the middle value of the range.

Usage
Range$getValue()
Returns

The middle value.


Method getMin()

Gets the minimum value of the range.

Usage
Range$getMin()
Returns

The minimum value.


Method getMax()

Gets the maximum value of the range.

Usage
Range$getMax()
Returns

The maximum value.


Method getMinMax()

Get the min/max range.

Usage
Range$getMinMax()
Returns

A list containing two fields: "min" and "max.


Method getDelta()

Gets the delta tolerance of the range.

Usage
Range$getDelta()
Returns

The delta tolerance.


Method getPpm()

Gets the PPM tolerance of the range.

Usage
Range$getPpm()
Returns

The tolerance in PPM.


Method getTolExpr()

Gets the tolerance expression as a list.

Usage
Range$getTolExpr()
Returns

A list containing the tolerance range expression.


Method clone()

The objects of this class are cloneable with this method.

Usage
Range$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples

# Convert a min/max range into a value/ppm tolerance:
rng <- Range$new(min=0.4, max=0.401)
value <- rng$getValue()
ppm <- rng$getPpm()


## ------------------------------------------------
## Method `Range$new`
## ------------------------------------------------

# Create an instance from min and max:
Range$new(min=1.2, max=1.5)

pkrog/biodb documentation built on Nov. 29, 2022, 4:24 a.m.