DOI: 10.5061/dryad.2ngf1vj11
title: Data and R code for: Linking climate variability to demography in cooperatively breeding meerkats

description: This dryad repository contains data sets and R scripts for our Ecological
 Monographs (2025) paper: Linking climate variability to demography in
 cooperatively breeding meerkats. The aim of our study was to develop a
 mechanistic understanding of how variation in rainfall and temperature
 affect meerkat demography. Specifically, we: Identified the critical
 period during which rainfall influences vegetation productivity at the
 field site. Investigated how vegetation productivity and temperature
 influence meerkat foraging performance. Examined how these climatic
 variables impact daily weight fluctuations and overall body condition.
 Analyzed conditions under which meerkats fail to accumulate enough mass
 during foraging to offset overnight losses. Explored the influence of body
 condition on reproduction and survival. Projected future temperature
 trends and their implications for meerkat populations up to the mid and
 end of the century. To achieve these aims, our study included numerous
 data sets and analyses which we detail in the README.  Please
 note that the individual, group, and litter identities have been
 anonymised for this study. This is to prevent anyone from trying to link
 different studies carried out by the Kalahari Meerkat Project, and using
 the data to conduct their own analyses without knowledge of how the data
 have been processed, or of the system from which they derive. Within our
 specific study, the identities are relationally-linked, so that, for
 example, Individual "4" is consistent across data sets.
description: The data was collected as part of a long-term study of meerkats
 in the southern Kalahari Desert. All methods of data collection are
 outlined in the paper and are also summarised in Clutton-Brock and Manser
 (2016). The project's data is stored on a centralised SQL database
 and was processed for analyses by the lead author using R.  
 All of the analyses are tied, directly or indirectly, to the
 effects of climate and/or vegetation productivity. Climate data included
 daily rainfall measured on-site, and temperature data taken from the NOAA
 Climate Prediction Centre. We also extracted future temperatures from the
 Coupled Model Intercomparison Project 6 (CMIP6) for two future pathways: a
 medium-risk scenario (SSP2-4.5) and a high-risk scenario (SSP5-8.5), which
 we obtained from the Copernicus Climate Change service
 (https://cds.climate.copernicus.eu/). We selected the EC-EARTH3-CC model
 from CMIP6. Vegetation productivity was assessed using NDVI from the MODIS
 MOD13Q1 product the GIMMS NDVI3g product. 
 Clutton-Brock, T.H., & Manser, M.B. (2016) Meerkat:
 cooperative breeding in the Kalahari<em>. In Cooperative breeding in
 vertebrates</em>. (eds, W.D. Koenig, & J.L. Dickinson), pp.
 294-317. Cambridge University Press, Cambridge, UK.
 https://doi.org/10.1017/CBO9781107338357.018
description: # Data and R code for: Linking climate variability to demography in
 cooperatively breeding meerkats #### **📁
 Thorley\_2025\_EcologicalMonographs.zip** Dataset DOI:
 [10.5061/dryad.2ngf1vj11](10.5061/dryad.2ngf1vj11) Each analysis is
 provided in a separate R script, with the data sets needed for each script
 explained in detail. **(1) `Part1_RainfallNDVI_Climwin.R`** \-
 **`MeerkatNDVIMasked.csv` **Average NDVI across the ranges of all meerkat
 groups (MODIS MOD13Q1). \- `date` – dd/mm/yyyy \- `mean_ndvi_masked` –
 NDVI is provided every 16 days \- **`MeerkatRainReserve.csv` **Daily
 rainfall at the field site. \- `date` – dd/mm/yyyy \- `rain_method` –
 Indicates how the daily value was collected (Manual / NOAA / Station) \-
 `rain_reserve` – Total daily rainfall (mm) **(2)
 `Part2_ForagingPerformance.R`** \-
 **`MeerkatForagingData.csv` **Historical data set of focal observations
 (1996–2001). \- `IndividID` – Individual identity \- `GroupRef` – Group
 identity \- `Focal_ID` – Unique identifier for the observations \-
 `FocalDate` – dd/mm/yyyy \- `FocalYear` – Year in which the focal was
 conducted \- `FocalMonth` – Month in which the focal was conducted \-
 `BehavObsDuration` – Duration of the focal observation (minutes) \-
 `numAvgHour` – Mid-point of the focal, as the hour of the day \- `tempmax`
 – Maximum temperature on the day of the focal (°C) \- `ndvi` – NDVI at the
 field site (GIMMS NDVI3g) \- `SuccForageBoutCount` – Number of successful
 prey pursuits (prey captures) \- `TotalDigDuration` – Time spent digging
 for prey (seconds) \- `DigProp` – Proportion of focal time spent digging
 **(3) `Part3_DWGandOML.R`** \-
 **`MeerkatWeeklyPopulationLevelDWG.csv` **Population-level average daily
 weight gain, averaged per week. \- `date` – dd/mm/yyyy \- `uniqueinds` –
 Number of unique individuals averaged \- `mean_morningmass` – Mean morning
 body mass (g) \- `mean_massresid` – Mean residual body mass (g), referred
 to as body condition in the paper (i.e., deviation from individual
 lifetime mass trajectories) \- `mean_percentmassgain` – % daily body mass
 gain (morning to evening), averaged over all individuals in the week \-
 `mean_absmassgain` – Absolute daily body mass gain (g), averaged over all
 individuals \- `ConditionChange_t_t1` – Change in average body condition
 from one week to the next (g) \-
 **`MeerkatIndividualDailyWeightGain.csv` **Individual daily body mass gain
 data. \- `date` – dd/mm/yyyy \- `Season` – Early summer / Late summer /
 Winter \- `IndividID` – Individual identity \- `GroupRef` – Group identity
 \- `Sex` – M / F \- `DomStatus` – Dominant or subordinate individual \-
 `BirthDate` – Date of birth (dd/mm/yyyy) \- `Age_year` – Age in years \-
 `MorningWeightTime` – Time of morning measurement (dd/mm/yyyy hh:ss) \-
 `EveningWeightTime` – Time of evening measurement (dd/mm/yyyy hh:ss) \-
 `MorningWeight` – Morning body mass (g) \- `EveningWeight` – Evening body
 mass (g) \- `WeightGain` – Daily body mass gain (g) \- `TimeDifference` –
 Time between measurements (hours) \- `percentmassgain` – % body mass gain
 (evening / morning × 100) \- `GroupSize_1moavg` – Average group size in
 the preceding month \- `tempmax` – Maximum daily temperature (°C) \-
 `ndvi_group` – Average NDVI within the home range (MODIS MOD13Q1) \-
 `mass_resid` – Residual body mass (g) \-
 **`MeerkatOvernightMassLoss.csv` **Individual overnight body mass loss.
 Combines daily weight gain (DWG) and overnight mass loss (OML) for
 estimating day-to-day mass changes. Columns as
 for `MeerkatIndividualDailyWeightGain.csv`, but also: \-
 `OvernightMassLoss_g` – Change in body mass from previous evening to
 morning (g) \- `OvernightMassLoss_percent` – % change in body mass from
 previous evening to morning \- `WeightChangeMorningToMorning` – Body mass
 change from one morning to the next (g) **(4)
 `Part4_DistributedLagModels.R`** \- **`MeerkatDailyTemp.csv`** Long-term
 daily temperatures from the Kuruman River Reserve. Data collected either
 at the field site (`_station`) or from the NOAA Climate Prediction Center
 (`_noaa`). \- `date` – dd/mm/yyyy \- `tempmin_noaa` – Minimum daily
 temperature (°C), NOAA \- `tempmax_noaa` – Maximum daily temperature (°C),
 NOAA \- `tempmid_noaa` – Mid-range daily temperature (°C), NOAA \-
 `tempmin_station` – Minimum daily temperature (°C), onsite \-
 `tempmax_station` – Maximum daily temperature (°C), onsite \-
 **`MeerkatNDVIMasked.csv`** *(As described in Part (1))* \-
 **`MeerkatWeeklyConditionAllAdults.csv` **Average weekly body condition of
 all adults contributing data. \- `week` – Week of the year \- `date` –
 dd/mm/yyyy \- `uniqueinds` – Number of distinct individuals \-
 `weeklyresid` – Mean weekly body condition (g) \- `weeklyreldev` –
 Proportional deviation in condition \- `n_weeklyresid` – Number of weight
 measurements used \- `Groupsize` – Average group size (incl. pups) \-
 `Groupsize_ExcPups` – Average group size (excl. pups) \-
 **`MeerkatWeeklyCondition[SubFemales|SubMales|DomFemales|DomMales].csv`**
 Same structure as above, separated by sex and dominance status. **(5)
 `Part5_VitalRates.R`** \- **`MeerkatPregnancySurvival.csv` **Pregnancy
 status and survival of individuals. \- `IndividID` – Individual identity
 \- `MonthStart` – Start of the month \- `Age` – Age at month start (days)
 \- `avgCondition` – Average monthly body condition (g); similar to
 `mass_resid`. NA indicates that an individual is missing body mass
 information for that month.  \- `TB` – Did the female have TB? (Y / N) \-
 `Dominant` – Was the female dominant? (Y / N) \- `Died` – Did the female
 die during the month? (0 / 1) \- `Diss` – Did the female disappear? (0 /
 1) \- `Preg` – Did the female fall pregnant in the month? (0 / 1). NA
 indicates months where the female was pregnant, thus neither 0/1.  \-
 **`MeerkatLitterSuccess.csv` **Weaning success of litters. \- `FemaleID` –
 Female identifier (same as `IndividID`) \- `ReprodRef` – Litter identifier
 \- `BirthDate` – Date of birth (dd/mm/yyyy) \- `Age` – Age of the mother
 at pregnancy start (days) \- `Cond7Day` – Average maternal condition (g)
 during week around pregnancy. NA indicates that an individual is missing
 body mass information for that week.  \- `TB` – Did the mother have TB? (Y
 / N) \- `Dominant` – Was the mother dominant? (Y / N) \- `LitterSuccess` –
 Were any pups weaned? (0 / 1) **(6) `Part6_FutureWarmingKalahari.R`** \-
 **`MeerkatCMIP6Tmax.csv` **Climate projections from CMIP6 EC-Earth3-CC
 model: number of days exceeding temperature thresholds. \- `year` – Year
 of model output \- `experiment` – historical / ssp245 (medium-risk) /
 ssp585 (high-risk) \- `model` – Model used (EC-Earth3-CC) \- `Longitude`,
 `Latitude` – Coordinates (°) \- `tmax35` – Days exceeding 35°C \- `tmax37`
 – Days exceeding 37°C \- **`MeerkatCMIP6ConsecutiveTmax.csv` **Same
 structure as above, but includes: \- Maximum number of consecutive days
 exceeding 35°C (`maxstreak35`) and 37°C (`maxstreak37`) thresholds \-
 **`data_0.cpg`,`data_0.dbf`, `data_0.prj`, `data_0.shp`, `data_0.shx`  **
 Shape files for the meerkat IUCN distribution used in plotting. ## Access
 information Other publicly accessible locations of the data: *
 [https://github.com/JThor1990/MkatConditionDemography](https://github.com/JThor1990/MkatConditionDemography)