county_events: Find events for storms by county

Description Usage Arguments Value Note Examples

View source: R/event_exposure.R

Description

Takes a list of US counties, based on their 5-digit Federal Information Processing Standard (FIPS) codes, boundaries on the range of years to be considered, and the type of event (e.g., "flood", "tornado") and returns a list of all storms with listings for that type of event for the counties. This output is based on listings in the NOAA Storm Events database. See the help documentation for the storm_events dataset for more information and references on the data source used by this function.

Usage

1
county_events(counties, start_year, end_year, event_type)

Arguments

counties

Character vector of the five-digit Federal Information Processing Standard (FIPS) codes for counties for which the user wants to determine storm exposure.

start_year

Four-digit integer with first year to consider.

end_year

Four-digit integer with last year to consider.

event_type

Character string with the type of event to use to identify county exposures. Options include "flood", "tornado", "wind", and "tropical_storm".

Value

Returns a dataframe with a row for each county-storm pair and with columns for:

Note

Of the event types that this function can pull, only "tornado" and "wind" are available for years before 1996. Therefore, this function will pull listed tornado events or wind events for all years, but for any other event type, you should not use a start year prior to 1996, as events of other types were not recorded in the database before 1996.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# Ensure that data package is available before running the example.
#  If it is not, see the `hurricaneexposure` package vignette for details
# on installing the required data package.
if (requireNamespace("hurricaneexposuredata", quietly = TRUE)) {

county_events(counties = c("37031", "37053", "37055"),
              start_year = 1996, end_year = 2018,
              event_type = "flood")

county_events(counties = c("37055"),
              start_year = 1996, end_year = 2018,
              event_type = "tropical_storm")
}

geanders/hurricaneexposure documentation built on Feb. 16, 2020, 8:19 a.m.