udunits2 (version 0.13.2.1)

ud.is.parseable: 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

Value

Returns a logical: True if the units is parseable and recognized by the udunits library, False otherwise.

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.

References

Unidata's udunits reference: https://www.unidata.ucar.edu/software/udunits/ API guide for ut_parse: https://www.unidata.ucar.edu/software/udunits/udunits-2.1.24/udunits2lib.html#index-ut_005fparse-43

See Also

ud.are.convertible

Examples

Run this code
# NOT RUN {
ud.is.parseable("K")             # TRUE
ud.is.parseable("  K  ")         # TRUE
ud.is.parseable("miles")         # TRUE
ud.is.parseable("Not parseable") # FALSE
# }

Run the code above in your browser using DataCamp Workspace