parse_damage: Parse damage values

Description Usage Arguments Details Value Examples

Description

Take damage values that include letters for order of magnitude (e.g., "2K" for $2,000) and return a numeric value of damage.

Usage

1
parse_damage(damage_vector)

Arguments

damage_vector

A character vector with damage values (e.g., the damage_crops or damage_property columns in the NOAA Storm Events data). This vector should give numbers except for specific abbreviations specifying order of magnitude (see Details).

Details

This function parses the following abbreviations for order of magnitude:

Value

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).

Examples

1
2
damage_crops <- c("150", "2K", "3.5B", NA)
parse_damage(damage_crops)

noaastormevents documentation built on Jan. 21, 2021, 5:11 p.m.