Learn R Programming

futureheatwaves (version 1.0.3)

apply_hw_projections: Apply a function to projected extreme events

Description

This function takes a user-specified function and applies is to a single file of extreme event projections, as specified by hwPath. It will generate either a single value for every ensemble member, if city_specific is set to FALSE, or a value for every city, if city_specific is set to TRUE.

Usage

apply_hw_projections(hwPath, FUN, city_specific = FALSE, ...)

Arguments

hwPath
A filepath to a comma-separated (.csv) file with a dataset of extreme events and their characteristics, as generated by gen_hw_set. The file at the specified filepath must conform exactly to the format of the extreme event files created by gen_hw_set.
FUN
A character string giving the name of a function to apply to the extreme event dataframe in the file specified by hwPath. This function must only take one argument, hw_datafr, which identifies a dataframe as generated by gen_hw_set. The function should output a single value (e.g., average heat wave length) when applied to the full dataframe.
city_specific
TRUE or FALSE, specifying whether the function should be applied separately for each study location.
...
Optional arguments to FUN.