Description Usage Arguments Value Note Examples
View source: R/wind_exposure.R
This function takes a dataframe with multi-county communities and returns a community-level dataframe of "exposed" storms, based on the highest of the maximum sustained wind speed for each county in the community.
1 | multi_county_wind(communities, start_year, end_year, wind_limit)
|
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. |
wind_limit |
A numeric vector of length one giving the minimum
wind speed (in meters per second) or duration of winds of 20 m / s or more
(in minutes) to use in the filter. The units of this variable will depend on
the user's choice for the |
Returns the same type dataframe as county_rain
,
but with storms listed by community instead of county.
This function currently will only input a threshold for the sustained wind
metric. If you would like to use gust winds or duration of winds, you will need
to use the county_wind
function to pull storms and aggregate to the
multi-county community level yourself.
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"))
wind_df <- multi_county_wind(communities = communities,
start_year = 1988, end_year = 2005,
wind_limit = 20)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.