getPlottingUnit: Interprets a unit key stings as a scaleing factor

Description Usage Arguments Value Examples

Description

Given a key string such as "milliseconds" (possibly abbreviated) or the abbreviation "ms" (identical matching), the unit (here milliseconds) and scaling factor (here 1e-3) is returned.

Usage

1
2
getPlottingUnit(unit = NULL, var = "Abundance", baseunit = NULL,
  implemented = c(1, 2, 3), def.out = TRUE)

Arguments

unit

A unit key string indicating the unit (see getPlottingUnit()$definitions$unlist.units for available key strings), or alternatively a numeric value giving the scaling factor.

var

A key string indicating the variable to plot (see getPlottingUnit()$defaults$Rstox_var for available values).

baseunit

The unit used in the data.

implemented

An integer vector giving the inplemented variables, which are the first two ("Abundance", "Weight") in the current version of Rstox.

def.out

Logical: if TRUE return also the defaults and definitions.

Value

a list of the following four elements: 1. the scaling factor, 2. the unit string, 3. a matrix of the default values, and 4. a matrix of the defintions.

Examples

1
2
3
getPlottingUnit(unit="milli", var="abund", baseunit="stox", def.out=FALSE)
getPlottingUnit(unit="milli", var="weight", baseunit="stox", def.out=FALSE)
getPlottingUnit(unit="hecto", var="weight", baseunit="stox")

Sea2Data/Rstox documentation built on May 14, 2019, 8:58 a.m.