ThermStats: an R package for quantifying surface thermal heterogeneity in assessments of microclimates

Rebecca A Senior, Jane Katharine Hill, David P. Edwards

Research output: Contribution to journalArticlepeer-review


1. Variation in temperature at a fine spatial scale creates critically important microclimates for many organisms. Quantifying thermal heterogeneity at this scale is challenging and, until recently, has been largely restricted to the use of dataloggers to record air temperature. Thermography is becoming an increasingly viable alternative. A single photo from a thermal imaging camera contains thousands of spatially explicit surface temperature measurements, making thermal cameras ideal for rapidly assessing temperature variation at fine scale.
2. Here, we present an R package – ThermStats – for processing thermal images and other gridded temperature data. The package addresses current constraints on applying thermography in ecology, by speeding up and simplifying the extraction of data from thermal images, and by facilitating the calculation of different metrics of thermal heterogeneity. The metrics capture both the frequency distribution and spatial patterns of temperature, and the package functions are designed to accommodate different sampling strategies and data in either matrix or raster format.
3. We demonstrate how ThermStats can be used to capture temperature variation at fine spatial scales in structurally complex habitat, such as tropical rainforest. Using thermal images collected in the field (~0.5 cm2 resolution), we found that thermal hetereogeneity varied little between primary and logged forest, but did vary with time of day. Comparing temperature extremes in a microclimate layer estimated from LIght Detection And Ranging (LIDAR) data (2,500 m2 resolution), we found that both hot and cold extremes were hotter inside oil palm plantations than in the neighbouring forest.
4. Our package simplifies the processing of thermal data, and our metrics capture key spatiotemporal temperature trends that underpin physiological, behavioural and demographic responses to environmental change. As such, ThermStats can advance a wide range of studies requiring fine-scale surface temperature data for microclimate investigations.
Original languageEnglish
JournalMethods in ecology and evolution
Early online date5 Jul 2019
Publication statusPublished - 1 Sept 2019

Bibliographical note

This is an author-produced version of the published paper. Uploaded in accordance with the publisher’s self-archiving policy. Further copying may not be permitted; contact the publisher for details.


  • infrared
  • microclimate
  • temperature
  • thermal camera
  • thermography
  • thermoregulation

Cite this