apply_hw_projections: Apply a function to projected extreme events

Description Usage Arguments Note

View source: R/applyHeatwaves.R

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

1
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.

Note

The function input as FUN must follow a very specific structure. It most have only one argument, and that argument must be a dataframe with extreme events and their characteristics, as generated by the gen_hw_set function. See the futureheatwaves vignette for more guidance on creating and applying a custom function to explore the extreme events identified and characterized by gen_hw_set.


futureheatwaves documentation built on May 2, 2019, 9:43 a.m.