Range {biodb} | R Documentation

## Range class.

### Description

Range class.

Range class.

### Details

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

### Methods

#### Public methods

- `Range$new()`

- `Range$getValue()`

- `Range$getMin()`

- `Range$getMax()`

- `Range$getMinMax()`

- `Range$getDelta()`

- `Range$getPpm()`

- `Range$getTolExpr()`

- `Range$clone()`

#### 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)

[Package biodb version 1.2.2 Index]