Description Usage Arguments Details Value Examples
Take damage values that include letters for order of magnitude (e.g., "2K" for $2,000) and return a numeric value of damage.
1 | parse_damage(damage_vector)
|
damage_vector |
A character vector with damage values (e.g., the |
This function parses the following abbreviations for order of magnitude:
"K": 1,000 (thousand)
"M": 1,000,000 (million)
"B": 1,000,000,000 (billion)
"T": 1,000,000,000,000 (trillion)
The input vector, parsed to a numeric, with abbreviations for orders of magnitude appropriately interpreted (e.g., "2K" in the input vector becomes the numeric 2000 in the output vector).
1 2 | damage_crops <- c("150", "2K", "3.5B", NA)
parse_damage(damage_crops)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.