Description Usage Arguments Value Examples
View source: R/filter_storm_data.R
This function is a helper function for many of the the other functions in this package that measure exposure.
1 2 3 4 5 6 7 8 9 10 |
counties |
A character vector listing all 5-digit county FIPS codes for a subset of counties. |
storm |
A character string giving the storm ID (e.g., "Floyd-1999") |
year_range |
A numeric vector of length two with the starting and ending year to subset to. |
distance_limit |
A numeric vector of length one giving the maximum distance (in kilometers) to use in the filter |
rain_limit |
A numeric vector of length one giving the minimum rain (in millimeters) to use in the filter |
include_rain |
A logical specifying whether to pull in rain data to use in the filter or give as output (default is FALSE) |
days_included |
A numeric vector giving the lag numbers for days to
include when calculating the total rain over the storm period (e.g.,
|
output_vars |
A character vector listing all the columns to include in the output. |
A dataframe with storms filtered based on the input criteria to the
function. Columns in the output will vary depending on the user's
selections for the output_vars
argument.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # 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)) {
filter_storm_data(counties = c("22071", "51700"), year_range = c(1988, 2011),
distance_limit = 250, rain_limit = 150,
include_rain = TRUE, days_included = c(-1, 0, 1),
output_vars = c("fips", "storm_id", "closest_date",
"storm_dist", "tot_precip"))
filter_storm_data(storm = "Floyd-1999", include_rain = TRUE,
days_included = c(-1, 0, 1),
output_vars = c("fips", "tot_precip"))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.