ud.is.parseable | R Documentation |
Determine whether a unit string is parseable and recognized by the udunits library.
ud.is.parseable(unit.string)
unit.string |
A character string representing a type of units which may be parseable by the udunits library |
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
.
Returns a logical: True
if the units is parseable and
recognized by the udunits library, False
otherwise.
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.
James Hiebert hiebert@uvic.ca
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
ud.are.convertible
ud.is.parseable("K") # TRUE ud.is.parseable(" K ") # TRUE ud.is.parseable("miles") # TRUE ud.is.parseable("Not parseable") # FALSE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.