Learn R Programming

futureheatwaves (version 1.0.3)

formHwFrame: Create heat wave dataframe for an ensemble

Description

This function takes inputs, from processProjections, on the projection data for an ensemble member, the thresholds for cities for the ensemble, and global and custom objects with user specifications. Using these inputs, the function creates a dataframe with heat waves identified and characterized for the ensemble member.

Usage

formHwFrame(ensembleSeries, thresholds, global, custom)

Arguments

ensembleSeries
A list object giving the projection time series as well as a variety of other information for a single ensemble member. This is the output of processEnsemble.
thresholds
A vector with the thresholds to use within each city in that city's heat wave definition.These are typically automatically determine during the run of the gen_hw_set function.
global
An list object created by gen_hw_set that includes user specifications (e.g., the path to the output directory, the path to the input climate projections, the dataframe with city locations).
custom
An list object created by gen_hw_set that includes user specifications (e.g., the name of the R function to use to identify heat waves, alternative upper and lower year boundaries for the data used to determine threshold temperatures for the heat wave definition, alternative upper and lower year boundaries for the projection period of the heat wave datasets being generated).

Value

The combined dataframe of identified and characterized heat waves for selected projection date range for all cities specified by the user. This dataframe includes the following columns:
  • hw.number: A sequential number identifying each heat wave in a city;
  • mean.temp: Average daily temperature across all days in the heat wave, in degrees Fahrenheit;
  • max.temp: Highest daily temperature across days in the heat wave, in degrees Fahrenheit;
  • min.temp: Lowest daily temperature across days in the heat wave, in degrees Fahrenheit
  • length: Number of days in the heat wave;
  • start.date: Date of the first day of the heat wave;
  • end.date: Date of the last day of the heat wave;
  • start.doy: Day of the year of the first day of the heat wave (1 = Jan. 1, etc.);
  • start.month: Month in which the heat wave started (1 = January, etc.);
  • days.above.80: Number of days in the heat wave above 80 degrees Fahrenheit;
  • days.above.85: Number of days in the heat wave above 85 degrees Fahrenheit;
  • days.above.90: Number of days in the heat wave above 90 degrees Fahrenheit;
  • days.above.95: Number of days in the heat wave above 90 degrees Fahrenheit;
  • days.above.99th: Number of days in the heat wave above the 99th percentile temperature for the city, using the period specified by the user with the referenceBoundaries argument in gen_hw_set as a reference for determining these percentiles;
  • days.above.99.5th: Number of days in the heat wave above the 99.5th percentile temperature for the city, using the period specified by the user with the referenceBoundaries argument in gen_hw_set as a reference for determining these percentiles;
  • first.in.season: Whether the heat wave was the first to occur in its calendar year (Note: this characteristic is likely not useful in southern hemisphere studies.);
  • threshold.temp: The temperature used as the threshold for the heat wave definition in the city;
  • mean.temp.quantile: The percentile of the average daily mean temperature during the heat wave compared to the city's year-round temperature distribution, based on the temperatures for the city during the period specified by the referenceBoundaries argument in gen_hw_set;
  • max.temp.quantile: The percentile of the highest daily mean temperature during the heat wave compared to the city's year-round temperature distribution;
  • min.temp.quantile: The percentile of the lowest daily mean temperature during the heat wave compared to the city's year-round temperature distribution;
  • mean.temp.1: The city's average year-round temperature, based on the temperatures for the city during the period specified by the referenceBoundaries argument in gen_hw_set;
  • mean.summer.temp: The city's average May--September temperature, based on the temperatures for the city during the period specified by the referenceBoundaries argument in gen_hw_set; and
  • city: The identifier for the city, as given in the file specified in the citycsv argument of gen_hw_set.
An example of the output of this function is available as the hw_datafr dataset and can be accessed using data(hw_datafr).