Find, Characterize, and Explore Extreme Events in Climate Projections

Inputs a directory of climate projection files and, for each, identifies and characterizes heat waves for specified study locations. The definition used to identify heat waves can be customized. Heat wave characterizations include several metrics of heat wave length, intensity, and timing in the year. The heat waves that are identified can be explored using a function to apply user-created functions across all generated heat wave files.This work was supported in part by grants from the National Institute of Environmental Health Sciences (R00ES022631), the National Science Foundation (1331399), and the Colorado State University Vice President for Research.

Build Status

The futureheatwaves package takes a directory of climate projection files and, for each, identifies and characterizes all of a certain type of multi-day extreme events (e.g., heat waves). The definition used to identify extreme events can be customized. Characterizations include several metrics of event length, intensity, and timing in the year. The identified extreme events can be explored by applying custom functions across all generated heat wave files.


You can download the latest stable version of this package directly from CRAN:


The development version of this package can be installed directly from GitHub using install_github from the devtools package:

install_github("geanders/futureheatwaves", build_vignettes = TRUE)

Because this package includes some C++ functions, this installation from GitHub requires the compiling of some code. If you get an error when trying to install this package from GitHub, it may be because your computer lacks the required tools to compile that part of the code. In this case, you can either download and install the required tools or email me to get a source version of the code for your operating system (where the C++ code has already been compiled).

Using the package

There are extensive details on using this package in the package vignette, which can be accessed once you install the package using:


A version of this vignette is also available through CRAN here.

The development version of the package also includes a vignette with details on how to prepare CMIP5 netCDF climate model output files for use with this package. If you have downloaded the development version of the package directly from GitHub, you can access that vignette with:




  • Add a function to create interactive leaflet maps to explore relationship between study cities and associated climate model grid points for each climate model.
  • Change so if user selects "n" when prompted to allow gen_hw_set to write files locally, the function returns NULL rather than an error, along with a message explaining the result.
  • Improve memory management for some of the functions. Some functions write to global objects. In previous versions, the functions also returned what they were writing to the global objects. However, this is unnecessary, so these functions have been changed to return NULL and so use less memory.
  • Change to use fread from data.table instead of read.csv to read in climate data from csv.
  • Change to have more general column names for output dataset (e.g., mean.var rather than mean.temp and mean.seasonal.var rather than mean.summer.temp), so results make more sense if using the package for something other than heat waves (e.g., severe air pollution episodes)
  • Parameter input_metric in gen_hw_set removed to make the package more generalizable to variables other than temperature.
  • Add capability to identify and characterize periods below a certain temperature (e.g., for "cold waves")
  • Add new vignette "Starting from netCDF" to provide more guidance in preparing climate model output netCDF files to use with this package

futureheatwaves 1.0.2

  • Add code so that package can process climate projections that include Feb. 29 or Feb. 30 (it defaults the start day and month of those heat waves to be Mar. 1). (Note: If there is a heatwave that starts on Feb. 29 in a non-leap year and only lasts two days, you may get an error. I think this will be a very rare case, but please email the package maintainer if you experience this problem.)

futureheatwaves 1.0.1

  • Fixed a bug in the C++ function to identify heatwaves. Originally, this function passed two integer vectors into NumericVector Rcpp classes. This occassionally caused a crash on some operating systems related to a call to coerceToReal. The function now passes these two integer vectors into IntegerVector Rcpp classes.
  • Added a file to track changes to the package.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


1.0.3 by Brooke Anderson, a year ago

Browse source code at

Authors: Brooke Anderson [aut, cre], Colin Eason [aut], Elizabeth Barnes [aut]

Documentation:   PDF Manual  

GPL-2 license

Imports data.table, dplyr, ggplot2, ggthemes, leaflet, Rcpp, stringr, tidyr

Suggests gridExtra, knitr, mapproj, maps, rmarkdown, testthat, weathermetrics

Linking to Rcpp

See at CRAN