Description Usage Arguments Value Examples
View source: R/distance_exposure.R
This function takes a dataframe with multi-county communities and returns a community-level dataframe of "exposed" storms, based on the shortest distance between the storm's track and the population-based centers of each county in the community.
1 | multi_county_distance(communities, start_year, end_year, dist_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. |
dist_limit |
Maximum distance, in kilometers, of how close the storm track must come to the county's population mean center to classify the county as "exposed" to the storm. |
Returns the same type dataframe as county_distance
,
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_distance(communities = communities,
start_year = 1995, end_year = 2005,
dist_limit = 75)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.