R: Determine whether a unit string is parseable by the udunits...
ud.is.parseable
R Documentation
Determine whether a unit string is parseable by the udunits library
Description
Determine whether a unit string is parseable and recognized by the udunits library.
Usage
ud.is.parseable(unit.string)
Arguments
unit.string
A character string representing a type of units
which may be parseable by the udunits library
Details
ud.is.parseable uses udunit's function ut_parse to
determine whether or not the given unit string is parseable. If
ut_parse returns NULL, then ud.is.parseable will return FALSE.
Value
Returns a logical: True if the units is parseable and
recognized by the udunits library, False otherwise.
Note
There is a note in the ut_parse docs about how the
argument string must have no leading or trailing whitespace. We make
sure in this package to always call ut_trim on any strings
before they are passed to ut_parse. The package user need not
strip whitespace before-hand.