Description Usage Arguments Details Value See Also
This function creates parsed units. Unlike unparsed character strings, parsed units are unambiguous and can be used for arithmetic operations.
1 | parse_units(ustrs, delimiter = "|")
|
ustrs |
character vector of unit strings, one string per set of units |
delimiter |
single character. The delimiter can be used to identify complex units - for example, with "|" as the delimiter, you might specify units of "|g SO_4^2-| m^-2 hr^-1". Then "g SO_4^2-" would be considered a single unit with power of 1. "m" and "hr" would also be recognized as units because they are separated by spaces and contain no internal special characters (such as spaces or "^"). |
Units strings are potentially ambiguous; a delimiter may be used to indicate where the text part of a unit begins and ends. For example, "g soil^-1" will be incorrectly parsed into "g" and "soil^-1", but this can be avoided by wrapping the two-word unit in the delimiter: "|g soil|^-1" will be parsed such that "g soil" is a single unit term.
This is a unit: "kg". This is another unit: "kgC_organic^2". This is a unit string: "kgC ha^-1 yr^-1". This is a vector of unit strings: c("kgC ha^-1 yr^-1", "PgN", "ft^3 s^-1").
This function is vectorized so that N unit strings will be turned into N internal representations.
list of data.frames, one per unit string passed in
Other unit-parsing functions: prepare_delimiter
,
simplify_units
, sort_units
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.