Skip to content

tash-g/WAAL-personality

Repository files navigation

Boldness predicts individual plasticity in flight responses to winds

Natasha Gillies, Henri Weimerskirch, Jack Thorley, Thomas A. Clay, Lucía Martina Martín López, Rocio Joo, Mathieu Basille, Samantha C. Patrick

Overview

This repository contains scripts and data to recreate the main results and figures of the following manuscript:

Boldness predicts plasticity in flight responses to winds. (2023) Gillies N, Weirmerskirch H, Thorley J, Clay TA, Martin Lopez LM, Joo R, Basille M, Patrick SC. Journal of Animal Ecology. 92(9): 1730-1742. DOI: https://doi.org/10.1111/1365-2656.13968

Scripts

A short description of each script is given below.

  • 1_HMM_construct-models.R This script is used to fit Hidden Markov Models (HMMs) with every possible combination of boldness and boldness by wind interaction covariates. AIC is used to compare the relative support for each. The code here fits the models, outputs the AIC for each, as well as autocorrelation and goodness-of-fit plots. Note: depending on processing power, each model may take several hours to compile and so this script will take several days to run to completion.
  • 2_HMM_stationary_probabilities.R This script takes the two best-supported models (for males and females respectively) and uses these to plot stationary probabilities corresponding to Figure 3 in the manuscript and Figure S4 in the Supplementary Information.
  • 3_HMM_transition_estimates.R This script takes the two best-supported models (for males and females respectively) and uses these to plot transition estimates corresponding to Figure 2 in the manuscript and Figures S1-S3 in the Supplementary Information.
  • 4_HMM_validation.R This script contains code to run our two validation methods, described in the Methods and Supplementary Information. In part 1) the behavioural output of our best-supported HMMs is compared with expert classification of behaviours from foraging tracks. In part 2) the value of each covariate in the best supported model is randomly shuffled 50 times, and support for this randomly shuffled model compared to the 'real' model. Note: depending on processing power, each randoised model in part 2 may take several hours to compile and so this script will take several days to run to completion.
  • SUPP-INF_wind_availability_by_personality.R This script contains code to run the analyses described in Supplementary Information, which compare wind speeds and wind directions experienced by birds as a function of their boldness measure.

Data inputs

These data are used in the above scripts. Note that all Rings/BirdIDs have been recoded and so cannot be linked to existing datasets. Please contact the authors if you would like to make use of these datasets, as we may be able to offer additional information, data, or advice.

  • WAAL_GPS_2010-2021_personality_wind.csv This is the main dataset for analysis. Each row corresponds to an individual GPS fix. The columns are as follows:

    • Ring: Factor encoding unique ID of bird
    • Sex : Factor encoding male (M) or female (F)
    • Year : Factor encoding year of tracking, between 2010-2020
    • Longitude : Longitudinal position of GPS fix; numeric
    • Latitude : Latitudunal position of GPS fix; numeric
    • DateTime : Date and time of fix to nearest second
    • WindSp : Wind speed in m/s; numeric
    • Dev.wind2 : Wind direction relative to bird trajectory; numeric
    • LoD : Factor denoting daytime (L) or night (D)
    • Trip_bout : Factor encoding individual trip identity
    • mean_BLUP_logit : Numeric boldness score for that individual
  • WAAL_GPS_2020-2021_wind_directions.csv Abridged dataset giving wind directions experienced for each individual at each GPS fix time point, used to compare wind availability for birds of different boldness scores in Supplementary Information. The columns are as follows:

    • Ring: Factor encoding unique ID of bird
    • time : Date and time of fix to nearest second
    • winddirection_blowingfrom : Wind direction for each fix; numeric
  • WAAL_gps_2020-2021_manualStates.csv Dataset giving expert classification of each GPS fix into a different behavioural state. Used for model validation described in Methods and Supplementary Information. The columns are as follows:

    • BirdID : Factor encoding unique ID of bird
    • TripID : Factor encoding individual trip identity
    • Sex : Factor encoding male (M) or female (F)
    • Year : Factor encoding year of tracking, between 2010-2020
    • DateTime : Date and time of fix to nearest second
    • Longitude : Longitudinal position of GPS fix; numeric
    • Latitude : Latitudunal position of GPS fix; numeric
    • STATE : Manual classification of behavior, where 1 = travel, 2 = search, 3 = rest