Description Usage Arguments Value Examples
View source: R/event_exposure.R
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.
1 | multi_county_events(communities, start_year, end_year, event_type)
|
communities |
A dataframe with the FIPS codes for all counties within
each community. It must include columns with a column identifier
( |
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 |
Returns the same type dataframe as county_events
,
but with storms listed by community instead of county.
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")
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.