Shiny app to explore these results is now live (built with code from ChatGPT).
This repository contains all of the code and most of the data to reproduce analyses exploring methods for measuring range edge positions and edge shifts. Please cite the paper and the repository DOI above for any derived work. The workflow is as follows:
01_prep_data.Rreshapes and filters the raw data. It uses spatial masks to do so, which are available in this repository as well. Not all the raw data are hosted here, because some files are too big (see "Data" below).02_calculate_edges.Rapplies range edge metrics to the data (see functions/calc_edge_quantile.R for more information on how they're calculated).03_analyze_edges.Rcalculates statistics about those range edge metrics, such as whether they shifted and how far. It also generates Figure 1 in the text.04_calculate_power.Rruns the simulation + non-random resampling described in the manuscript, and calculates power for different parameter combinations.05_analyze_power.Rcalculates summary statistics and makes plots based on the simulation in the previous step.
This project used data on an example fish and bird species. Processed datasets are available in this repository, so you don't need to run the script to regenerate them (01_prep_data.R) in order to reproduce the results.
The fish species data comes from FISHGLOB v2.0.1. I am quite familiar with these data so I chose a species that I knew was conducive to this analysis, white hake.
To choose a bird species, I leveraged La Sorte and Thomspon III 2007, specifically their supplemental table A1. I filtered those data for southern species that were common and had a demonstrated northward shift in the analysis. Then I explored some range maps and settled on the Black Vulture.
To download Christmas Bird Count data on the Black Vulture, I used the Audubon data portal. It had some bugs at the time so after emailing with CBC folks I manually downloaded every count from 1975 to 2023 (the most recent available at that time) for Black Vulture.
To generate the spatial mask used to crop the fish data, I downloaded data on global EEZs from marineregions.org.