# NOT RUN {
# 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)) {
# For these examples to work, you will need to have a directory called "tmp"
# as a subdirectory of your home directory. These examples will create new
# directories with exposure output to that "tmp" directory.
# By county
distance_exposure(locations = c("22071", "51700"),
start_year = 1995, end_year = 2005,
dist_limit = 75,
out_dir = "~/tmp/storms")
# For multi-county communities
communities <- data.frame(community_name = c(rep("ny", 6), "no", "new"),
fips = c("36005", "36047", "36061",
"36085", "36081", "36119",
"22071", "51700"))
distance_exposure(locations = communities,
start_year = 1995, end_year = 2005,
dist_limit = 75,
out_dir = "~/tmp/storms")
}
# }
Run the code above in your browser using DataCamp Workspace