DOI: 10.5061/dryad.5qfttdzgj
title: Data from: Consistent long-distance foraging flights across years and seasons at colony level in a Neotropical bat

description: All foraging animals face a trade-off: how much time should they invest in
 exploitation of known resources versus exploration to discover new
 resources? For group-living central place foragers, this balance is
 challenging. Due to the nature of their movement patterns, exploration and
 exploitation are often mutually exclusive, while the availability of
 social information may discourage individuals from exploring. To examine
 these trade-offs, we GPS-tracked groups of greater spear-nosed bats
 (Phyllostomus hastatus) from three colonies on Isla Colón, Panamá. During
 the dry season, when these omnivores forage on the nectar of unpredictable
 balsa flowers, bats consistently travelled long distances to remote,
 colony-specific foraging areas, bypassing flowering trees closer to their
 roosts. They continued using these areas in the wet season, when feeding
 on a diverse, presumably ubiquitous diet, but also visited other,
 similarly distant foraging areas. Foraging areas were shared within, but
 not always between colonies. Our longitudinal dataset suggests that bats
 from each colony invest in long-distance commutes to socially learned
 shared foraging areas, bypassing other available food patches. Rather than
 exploring nearby resources, these bats exploit colony specific foraging
 locations that appear to be culturally transmitted. These results give
 insight into how social animals might diverge from optimal foraging.
description: The data set used in this analysis was collected at three
 different colonies of <em>Phyllostomus hastatus, </em>in Isla
 Colón, Bocas del Toro, Panamá during the years 2016 -2023. Bats were
 captured inside caves, over roost cavities, using a ring trap. Bats were
 processed and biologgers were attached to their backs using skin glue. The
 biologgers lasted for 1-14 days. The GPS data retrieved
 from the GPS devices are stored in the Movebank repository.
 GPS data can be found in the following links:
 2016 data: O’Mara, MT, Dechmann, DKN. 2023. Data
 from: Greater spear nosed bats commute long distances alone, rest
 together, but forage apart.  Movebank Data Repository. https://doi.org/10.5441/001/1.282 2021-2022 data: Calderón-Capote MC, van Toor ML,<strong> </strong>O'Mara MT,  Bayer TD, Crofoot MC, Dechmann DKN. [Year]. Data from: Consistent long-distance foraging flights across years and seasons at colony level in a Neotropical bat [2021-2022]. Movebank Data Repository. https://doi.org/10.5441/001/1.321 2023 data: Bayer TD, Barría LM, Gómez LF, Lee JP, Aguilar G, O’Mara MT. 2024. Data from: Consistent long-distance foraging flights across years and seasons at colony level in a Neotropical bat [2023]. Movebank Data Repository. https://doi.org/10.5441/001/1.322 The GPS data also includes associated reference data from the bats available at Movebank Data Repository (same links provided). The GPS data was analyzed following the code workflow files in this reposirory using the R version 4.3.3 (2024-02-29). R files are commented accordingly to ensure the reproducibility of the analysis.
description: # Data from: Consistent long-distance foraging flights across years and
 seasons at colony level in a Neotropical bat
 [https://doi.org/10.5061/dryad.5qfttdzgj](https://doi.org/10.5061/dryad.5qfttdzgj) ## Description of the data and file structure We captured 216 individuals (134 females, 82 males) at three different caves on Isla Colón, Bocas del Toro, Panamá, during the dry season (February-March) in 2016 and 2022, and wet season (December, August) in 2021 and 2023. Colonies 1-3 were located inside caves. We used a ring trap over the roosting cavities. We tracked only adults with different biologgers and programming schedules. Tags were wrapped in shrink tube and glued (Osto-bond, Montreal Ostomy) to bats’ backs. The description of the model files in stan.zip is given in workflow No. 9. ### Files and variables To run the code from the file number 1, it is necessary to download the data from Movebank Repository. Data is available in the following links: * 2016 doi: [https://doi.org/10.5441/001/1.282](https://doi.org/10.5441/001/1.282) - 2021-2022 data: [https://doi.org/10.5441/001/1.321](https://doi.org/10.5441/001/1.321) - 2023 data: [https://doi.org/10.5441/001/1.322](https://doi.org/10.5441/001/1.322) To run script 8. Phyllostomus_appendix_stan_models.qmd the stan models inside stan.zip file are required. **Attributes of the data**  Descriptions of the columns in the dataset downloaded from Movebank are available in the Movebank Attribute Dictionary: [http://vocab.nerc.ac.uk/collection/MVB](http://vocab.nerc.ac.uk/collection/MVB) and [www.movebank.org/node/2381](http://www.movebank.org/node/2381). **Inside the code:** We created additional columns to analyze the data. Additional columns are: * *cave:* column corresponding to name of the cave. Colonies have been renamed in parts of the code and in the manuscript as colonies 1, 2, and 3. Original names during the capturing/tagging process are: *  La Gruta cave= colony 1 *  Aj cave = colony 2 * Muddy cave= colony 3 * *seasons:* corresponds to the wet and dry season. * *year_cave*: corresponds to the tracking year and name of the cave ( i.e 2016_lagruta) or tracking year, name of the cave and month, when tracked in different months in the same year (i.e. 2022_lagruta_Feb). For purpose of the paper "2022_lagruta_Feb" was renamed as "colony 1 early 2022" y and "2022_lagruta_March" as "colony 1 late 2022". "early" and "late" corresponds to tracking periods early and late in the dry season. * *BatDay:* describes the night number to which each bat was tracked. * *ID:* corresponds to the "tag_local_indentifier" and "date" (i.e "74DCA83_2016-02-29"). * *ID_batDay:* corresponds to the "tag_local_indentifier" and "BatDay" (i.e "74DCA83_1"). ## Code/software R is required to run the following code. The script uses the version 4.3.3. The code presents the analysis workflow to test how *Phyllostomus hastatus* shows consistent foraging flights across years and colonies. The code requires downloading the data from Movebank. For reproducibility of the maps, an API key from stadiamaps is necessary ("To obtain an API key and enable services, go to [https://client.stadiamaps.com/signup/](https://client.stadiamaps.com/signup/)."). The required packages and annotations are listed throughout the script. The workflow is a follows: 1\. CleaningData_Bocas2021-2022: this file cleans the data from the years 2021-2022. 2\. CleaningData_2023: this file cleans the data from the year 2023. 3\. CleaningData_2016: this file cleans the data from the year 2016. 4\. Merge_alldata: this file merge all data frames previously cleaned in code files 1-3. 5\. Behavioral_classification: this file contains the classification of the GPS locations into commuting and foraging based on HMM 2-state models. 6\. MainlandForaging_Figure1_FigureS4: this file contains the calculation of the proportion of foraging on and off the island for each individual that has at least one complete night across tracking periods. It contains the code for the Figures 1 and S4. 7\. Straightness: this file contains the calculation of  the straightness index for each complete outbound commute across tracking periods. 8\. Phyllostomus_appendix_simulations.qmd: this file contains the development of the Hidden Markov model set up for the simulation of bat nightly trips. This includes the code for the regularisation of trajectories. 9\. Phyllostomus_appendix_stan_models.qmd: this file contains the analysis of observed and simulated foraging locations using generalised linear mixed-effects models. The models were implemented in STAN and can be found in the folder stan.zip which contains the files movement.stan and movement-centered.stan. These files are text files that contain the stan-code for the actual models. Additionally, the stan.zip file contains other files which are just derivatives from the .stan files compiled for running the models (not required for running this script). The document also contains the code written to compute contrasts, and to visualise the model and results. 10\. Figure_1: This file contains the steps to develop figure 1. 11\. FigureS5: This file contains the steps to develop figure S5. Additionally, this repository contains as appendixes the stan models simulations performed as .html files. ## Access information Other publicly accessible locations of the data: Data from 2016 is available at: O’Mara, MT, Dechmann, DKN. 2023. Data from: Greater spear nosed bats commute long distances alone, rest together, but forage apart.  Movebank Data Repository. (doi:[https://doi.org/10.5441/001/1.282](https://doi.org/10.5441/001/1.282))