DOI: 10.6084/m9.figshare.23256845.v2
title: Data and R code for "Dolphin social phenotypes vary in response to food availability but not the North Atlantic Oscillation index" - post correction

description: Two text files containing data and one .R file with R code. These files are sufficient to recreate the analysis found in the manuscript "Dolphin social phenotypes vary in response to food availability but not the North Atlantic Oscillation index", published in Proceedings of the Royal Society B: Biological Sciences in October 2023 and corrected in October 2024 (see below).<br>In brief, the data are based on regular observations of bottlenose dolphins (<i>Tursiops truncatus</i>) off the north east coast of Scotland between 1990 and 2021 inclusive. Regular observations of dolphins co-occurring in groups allowed us to infer social associations and to build social networks. We built social networks for each month and each year there were sufficient observations. From each network we calculated three social network measures (strength, weighted clustering coefficient, and closeness) and we then analyses how these traits vary at both the yearly and monthly scale in response to variation in the North Atlantic Oscillation index and to salmon abundance (data obtained from other sources). We upload the dataset both before filtering (suffix "raw", including individuals of unknown sex and with only a few observations per year/month) and the dataset after filtering which is used for the analyses in the paper.The correction revolves around the calculation of the social network measure "closeness" using the R package <i>igraph</i>. We determined that this function treats the interaction strengths between individuals as distances or costs, where higher values mean more distant/less well-connected. This interpretation of interaction strengths is opposite to how they are interpreted for most other social network metrics, where higher values indicate closer and more well-connected individuals. The consequences are that the closeness values we analysed in the original version of the article are incorrect, and so the results and conclusions around closeness are erroneous. We then re-calculated closeness using a different R package, <i>tnet</i>, which treats interaction strengths in the manner expected i.e., higher values mean closer together, and re-ran all analyses involving closeness. See the supporting documentation of the paper for a description of the changes to the results in full.<br>"Dol Soc by Env Yearly data tC.txt" is the data frame for the yearly scale analysis, with network metrics per individual per year and environmental variables per year. Columns are:<br>dol_name - the unique ID of the dolphinyear - the year of observationsex - sex of the dolphin, 1 = male, 2 = femaleyear_nao - the north atlantic oscillation index record for that yearyear_fish - the yearly salmon abudance measureindiv_str - the individual's strength in that yearindiv_cc - the individual's weighted lcustering coefficient in that yearindiv_close - the individual's closeness in that year<br>"Dol Soc by Env Monthly data tC.txt" is the data frame for the monthly scale analysis, with network metrics per individual per month and environmental variables per month. Columns are:<br>dol_name - the unique ID of the dolphinyear - the year of observationmonth - the month of observation, coded numerically i.e., April = 4sex - sex of the dolphin, 1 = male, 2 = femalemonth_year_nao - the north atlantic oscillation index record for that monthmonth_year_fish - the monthly salmon abundance measureindiv_str - the individual's strength in that monthindiv_cc - the individual's weighted clustering coefficient in that monthindiv_close - the individual's closeness in that month<br>"Dol Soc by Env Monthly data tC raw.txt" and "Dol Soc by Env Yearly data tC raw.txt" are the above datasets but prior to filtering (see R code).<br>"Fisher & Cheney code Dol Soc by Env tC.R" is the R code file to recreate the analyses found in the manuscript (a series of mixed-effect models). We used R version 4.3.1 for the analysis. Note requires loading the packages "glmmTMB" (version 1.1.7) and "car" (version 3.1-2) so they must be installed first. Additionally, you will need to save the following R script: https://github.com/hschielzeth/RandomSlopeR2/blob/master/condR.R and refer to it with the source() command to enable the calculation of conditional repeatabilities.