multi_county_events: Hurricane exposure by events for communities

Description Usage Arguments Value Examples

View source: R/event_exposure.R

Description

This function takes a dataframe with multi-county communities and returns a community-level dataframe of "exposed" storms, based on the type of the event.

Usage

1
multi_county_events(communities, start_year, end_year, event_type)

Arguments

communities

A dataframe with the FIPS codes for all counties within each community. It must include columns with a column identifier (commun) and with the FIPS codes of counties included in each community (fips). See the example code.

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 the same type dataframe as county_events, but with storms listed by community instead of county.

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

communities <- data.frame(community_name = c(rep("ny", 6), "no", "new"),
                         fips = c("36005", "36047", "36061",
                                  "36085", "36081", "36119",
                                  "22071", "51700"))
distance_df <- multi_county_events(communities = communities,
                                     start_year = 1995, end_year = 2005,
                                     event_type = "flood")
}

hurricaneexposure documentation built on March 26, 2020, 8 p.m.