validDim: Determine whether a 1D dimension string is known and of the...

View source: R/unit.conversions.R

validDimR Documentation

Determine whether a 1D dimension string is known and of the expected dimension type

Description

Determine whether a 1D dimension string is known and of the expected dimension type

Usage

validDim(dimstr, dim.type = c("ANY", "volume", "time", "mass", "count",
  "area"))

Arguments

dimstr

A string representing one units dimension (just one at a time, please). For example: kg, d, or m^3, but not kg/d or d^-1

dim.type

One or more acceptable dimension types

Examples

loadflex:::validDim('kg') # TRUE
loadflex:::validDim('kg', 'mass') # TRUE
loadflex:::validDim('kg', 'volume') # FALSE
loadflex:::validDim('whoknows') # FALSE
loadflex:::validDim('whoknows', 'time') # FALSE

USGS-R/loadflex documentation built on July 26, 2023, 9:54 p.m.