Data from: Reconstructing 120 years of climate change impacts on Joshua tree flowering
Data files
Jun 14, 2024 version files 293.96 MB
-
output.zip
293.95 MB
-
README.md
13.63 KB
Abstract
Quantifying how global change impacts wild populations remains challenging, especially for species poorly represented by systematic datasets. Here, we infer climate change effects on masting by Joshua trees (Yucca brevifolia and Y. jaegeriana), keystone perennials of the Mojave Desert, from 15 years of crowdsourced observations. We annotated phenophase in 10,212 geo-referenced images of Joshua trees on the iNaturalist crowdsourcing platform, and used them to train machine learning models predicting flowering from annual weather records. Hindcasting to 1900 with a trained model successfully recovers flowering events in independent historical records, and reveals slightly rising frequency of conditions supporting flowering since the early 20th Century. This reflects increased variation in annual precipitation, which drives masting events in wet years — but also increasing temperatures and drought stress, which may have net negative impacts on recruitment. Our findings reaffirm the value of crowdsourcing for understanding climate change impacts on biodiversity.
Readme updated 13 June 2024.
Project description
This repo contains code to (1) use the iNaturalist API to download species observations based on phenology annotations, by modifying code from the rinat package, and (2) model the relationship between flowering and weather using spatially interpolated records from PRISM and Bayesian additive regression tree methods implemented in dbarts with utilities from embarcadero.
The code is provided as supporting data for
Yoder JB, AK Andrade, LA Defalco, TC Esque, CJ Carlson, DF Shryock, R Yeager, and CI Smith. 2024. Reconstructing 120 years of climate change impacts on Joshua tree flowering. Ecology Letters.
Contents
Subfolder names and contents:
data--- created programmatically to store raw data, as output by theinat_phenology_download.Rscript, PRISM climate layers, and validation records; not retained in this repositoryprotocol_manual--- a PDF document describing our protocol for adding phenology annotations to the iNaturalist database, with supporting Markdown and image files, suitable for compilation using Pandocscripts--- all project scripts, all in Rget_inat.R--- script to loadrinatand modify theget_inatfunction to allow searches on phenology state annotation.inat_phenology_download.R--- script to useget_inat.Rto download phenology-annotated observations using the iNaturalist APIPRISM_data-management.R--- downloads monthly climate data by year, summarizes to quarterly, normalizes to 1981-2010, and crops to the Mojave extent to build a repository for downstream workinat_phenology_data-management.R--- organization of data output frominat_phenology_download.R, and pairing with PRISM data with functionality from theprismpackage.phenology_modeling.R--- modeling annualized, rasterized observations of flowering (or no flowering) predicted with weather data using Bayesian additive regression tree (BART) methodsphenology_prediction.R--- fits random intercept models based on the best-fit fromphenology_modeling.R, with year as the random effect, uses that to predict flowering from PRISM data for 1900-presenthistoric_flowering_analysis.R--- analysis of the historic flowering prediction fromphenology_modeling.Rvalidation_records_analysis.R--- compares historic flowering predictions to independent validation records
output--- processed data products, modeling results, analysis and figures. See below for annotation of columns in data product filesflowering_obs_rasterized.csv--- flowering observations, rendered binary (flowering/no) and rasterized to the 4km PRISM resolution, output frominat_phenology_data-management.Rflowering_obs_climate.csv--- rasterized binary flowering observations merged with predictors generated from PRISM weather data, and annotated for Joshua tree species (eastern Yucca jaegeriana or western Yucca brevifolia), output frominat_phenology_data-management.R--- this is the basis for model trainingexpert_obs_validations.csvandnews_reports_prFL.tsv--- independent records validating model predictions- predicted flowering from the hindcast models for 4-km grid cells in the range of Joshua tree:
historic_flowering_reconst_jotr.csv, --- for non-RI and RI models trained on data from eastern and western Joshua trees;historic_flowering_reconst_YUJA.csvandhistoric_flowering_reconst_YUBR.csv--- for models trained from either eastern (YUJA) or (YUBR) data alone;jotr_reconstructed_flowering_years.csvandjotr_flowering_predictors_change.csv--- reconstructed flowering years in early (1900-1929) and recent (1990-2019) 30-year periods, changes in flowering years between those periods, and changes in weather predictors of flowering between those periods, in each grid cell covered by the historic flowering reconstructions;
BART--- saved BART models and prediction layersspartials--- raster-stack data layers (paired.griand.grdfiles) giving spatial partial effects of the six model predictors for each year 1900 to 2023predictions--- raster-stack data layers (paired.griand.grdfiles) giving predicted probability of flowering masked to the range of the two Joshua tree species, or unmasked (_nomask), for each year of 1900 to 2023, for different models as follows:jotr_BART--- "base" model, trained on data from both speciesjotr_BART_RI--- RI (random intercept) model, trained on data from both speciesYUJA_BART--- base model, trained on data from YUJA (Yucca jaegeriana, eastern Joshua tree) aloneYUBR_BART--- base model, trained on data from YUBR (Yucca brevifolia, western Joshua tree) alone
models--- R data format (.rds) files for trained models, the variable importance analysis (bart.varim.Jotr.rds), and year-year leave-one-out analyses for the "base" and RI models trained on data from both species (year-year-LOO.csvandRI_year-year-LOO.csv), all products of thephenology_modeling.Rscript, which explains their specific contents
figures--- figures output by analysis of data in the output folder; all are in the paper or SI, with captions provided in those documents
Usage
Some of these steps can be skipped once data is downloaded/organized, but to perform the full analysis for the first time, use the scripts in this order:
- First use
inat_phenology_download.Rto download all of the iNaturalist observations with flowering status annotated (this script sourcesget_inat.R); - Then use
PRISM_data-management.Rto download spatially interpolated weather data at 4km resolution and process it into quarterly aggregates, then into the composite ; - Then, use
inat_phenology_data-management.Rto match iNat observations to weather results for the years leading up to each observation; - Finally, use
phenology_modeling.Rto builds a BART model predicting flowering status with weather data, which are stored inoutput/flowering_obs_climate_normed.csv; and usephenology_prediction.Rwith the resulting model to predict what flowering was like in years when we have weather data but no iNaturalist observations. - Analysis of the predicted/hindcast flowering is conducted with code in
historic_flowering_analysis.Rand compared to independent validation records invaldiation_records_analysis.R
Contents of data product files in output
flowering_obs_rasterized_subsp.csv--- binary records of flowering activity by flowering year and location, rasterized to the 4km^2 grid of PRISM data layerslon: longitude, in decimal degreeslat: latitude, in decimal degreestype: Joshua tree species, either YUJA (Yucca jaegeriana, eastern Joshua tree) or YUBR (Yucca brevifolia, western Joshua tree)year: flowering year observedflr: whether or not evidence of flowering (buds, flowers, or fruit) is recorded for the given location and year
flowering_obs_climate_subsp.csv--- records as inflowering_obs_rasterized_subsp.csvwith weather predictor values for the same locations, derived from the PRISM database. Columns in common withflowering_obs_rasterized_subsp.csvare as given above; weather predictor columns follow the following naming conventions:ppt: precipitation, in mmvpdminandvpdmax: annual minimum and maximum vapor pressure deficit, in hPatminandtmax: annual minimum and maximum temperature, in CentigradeY0: predictor value for the year in which flowering activity is observedY1: predictor value for the year one year prior to observationY2: predictor value for the year two years prior to observationY0Y1: predictor value difference, Y0 - Y1Y1Y2: predictor value difference, Y1 - Y2
derived_predictors_jtrange.csv--- values for the set of weather predictors injotr_reconstructed_flowering_years.csv, for each 4km grid cell in the range of the two Joshua tree species, in each flowering year from 1900 to 2022; column names are as in other data product fileshistoric_flowering_reconst_jotr.csv,historic_flowering_reconst_YUJA.csv, andhistoric_flowering_reconst_YUBR.csv--- modeled historic flowering activty for grid cells within the range of both Joshua tree species (_jotr) or individual species (YUJAandYUBR):lon: longitude, in decimal degreeslat: latitude, in decimal degreesyear: flowering year predictedprFL: probability of flowering predicted by the "base" model (without a RI effect); note that the best-power cutoff for binary classification is prFL >= 0.26RI.prFL: probability of flowering predicted by the RI model; best-power cutoff for binary classification is RI.prFL >= 0.25
jotr_reconstructed_flowering_years.csv--- flowering years predicted by the "base" and RI models in each 4km grid cell across the range of both Joshua tree species, over the specified time periodslon: longitude, in decimal degreeslat: latitude, in decimal degreesflyrs_all: total flowering years predicted by the base model, 1900-2022flyrs_1900_1929: total flowering years predicted by the base model, 1900-1929flyrs_1990_2019: total flowering years predicted by the base model, 1990-2019flyrs_RI_all: total flowering years predicted by the RI model, 1900-2022flyrs_RI_1900_1929: total flowering years predicted by the RI model, 1900-1929flyrs_RI_1990_2019: total flowering years predicted by the RI model, 1990-2019flyrs_change: difference in flowering years between the recent (1990-2019) and early (1900-1929) periods, as predicted by the base model; positive values indicate more flowering years in the recent periodflyrs_RI_change: difference in flowering years between the recent (1990-2019) and early (1900-1929) periods, as predicted by the RI model; positive values indicate more flowering years in the recent period
jotr_flowering_predictors_change.csv--- recent (1990-2019) versus early (1900-1929) flowering years predicted by the base and RI models, compared to change in median weather predictor values for the same locations and periodslon: longitude, in decimal degreeslat: latitude, in decimal degreestimeframe: either early (from_1900_1929) or recent (from_1990_2019)flyrs: number of flowering years predicted for the given location and timeframeri.model: whether flowering years are as predicted by the base (FALSE) or RI (TRUE) modelpredictor: weather predictor identity from the set injotr_reconstructed_flowering_years.csv, formatted for figure productionpred_value: median value for the given weather predictor in the given location and timeframe
expert_obs_validations.csv--- formal records of flowering activity derived from field notes, herbarium records, and other published datasets, for use in model validationlon: longitude, in decimal degreeslat: latitude, in decimal degreeslocation: locality identification or description given by the data sourcetype: Joshua tree species, either YUJA (Yucca jaegeriana, eastern Joshua tree) or YUBR (Yucca brevifolia, western Joshua tree)year: flowering year of observationobs_by: data sourceobs_flowers,obs_fruit,obs_moths, andobs_no_flowers: whether or not the source records observations of flowers, fruits, pollinating yucca moths, or no evidence of floweringflr: binary classification of source observations into evidence of flowering (flowers or fruits recorded) or no floweringjotr_prFlr,jotr_RI.prFlr,YUBR_prFlr, andYUJA_prFlr: probability of flowering for the given location and year, predicted by the base model or RI model trained on data from both species (jotr); or non-RI models trained on data from each species individually (YUJAandYUBR)jotr_Flr,jotr_RI.Flr,YUBR_Flr, andYUJA_Flr: binary classifications of flowering activity for the given location and year, from predictions by the base model or RI model trained on data from both species (jotr); or non-RI models trained on data from each species individually (YUJAandYUBR)
news_reports_prFL.tsv--- summary information from historic newspaper accounts of flowering activityyear--- flowering year of the accountlocation--- location described in the accountrpt_by--- newspaper source for the accountrpt_date--- date of publication for the account,yyyy-mm-ddformatflr--- whether intense flowering is reported (TRUE) or poor flowering is reported (FALSE)qt--- excerpt of article text supporting the classification inflrprFL.loc--- probability of flowering predicted by the base model in the flowering year described by the report, averaged within a polygon for the specified locationprFL.all--- probability of flowering predicted by the base model in the flowering year described by the report, averaged over the full range of the two Joshua tree species
- Yoder, Jeremy (2024), Data from: Reconstructing 120 years of climate change impacts on Joshua tree flowering, , Article, https://doi.org/10.5281/zenodo.10976873
- Yoder, Jeremy (2024), Data from: Reconstructing 120 years of climate change impacts on Joshua tree flowering, , Article, https://doi.org/10.5281/zenodo.10976872
- Yoder, Jeremy B.; Andrade, Ana Karina; DeFalco, Lesley A. et al. (2024). Reconstructing 120 years of climate change impacts on Joshua tree flowering. Ecology Letters. https://doi.org/10.1111/ele.14478
