DOI: 10.5061/dryad.931zcrjs5
title: Data and code from: Birds optimize fruit size consumed near their geographic range limits

description: Animals can adjust their diet to maximize energy or nutritional intake.
 For example, birds often target fruits that match their beak size as these
 can be consumed more efficiently. We hypothesize that pressure to optimize
 diet — measured as matching between fruit and beak size — increases under
 stressful environments, such as those determining species’ range edges.
 Using fruit-consumption and trait information for 97 frugivorous bird and
 831 plant species across six continents, we demonstrate that birds feed
 more frequently on closely size-matched fruits near their geographic range
 limits. This pattern was particularly strong for highly frugivorous birds,
 whereas opportunistic frugivores showed no such tendency. These findings
 highlight how frugivore interactions might respond to stressful conditions
 and reveal that trait matching may not predict resource use consistently.
description: # Data and code from: Birds optimize fruit size consumed near their
 geographic range limits
 [https://doi.org/10.5061/dryad.931zcrjs5](https://doi.org/10.5061/dryad.931zcrjs5) ## Description of the data and file structure The scripts and data presented here are part of the article "Birds optimize fruit size consumed near their geographic range limits". # Folders, subfolders and files list and descriptions: frugivory_range: Main folder containing the scripts and datasets | \|- *data: Subfolder containing the data necessary for running the analyses*/ \| |- dataframes: subfolder containing the dataframes with our predictor and response variables \| |- networks: Subfolder containing the data necessary for updating and cleaning the plant-frugivore networks/ \| | |- original_networks: folder to store network data from Martins et al 2022 \| |- trait_data: files containing fruit and bird trait data \| - *results: Subfolder containing results of our models and sensitivity analyses*/ \| |- figures_bird: subfolder created to store the scatter plots of bird species \| |- model_selection: subfolder containing R files with the results of our model selection \| |- sensitivity: subfolder containing R files with the results of our sensitivity analyses \|- *00_functions.R: Code - Functions to be used in the analyses of the paper* \|- *01_networks.R: Code for uploading and updating network data* \|- *02_model_selection_gape.R: Code for running model selection using gape size data* \|- *03_model_selection_beak.R: Code for running model selection using beak width data* \|- *04_model_selection_pos.R: Code for running model selection without negative distance values* \|- *05_model_selection_std.R: Code for running model selection using the standadardized version of our models* \|- *06_sensitivity_analyses.R: Code fur running sensitivity analyses* \|- *07_variance_explained.R: Code for calculating the variance explained (R-squared) of our models* \|- *08_figures_main_text.R: Code for generating the figures presented in the paper* \|- *09_supplementary_models_figures.R: Code for generating figures of our supplementary models* \|- 10_figures_sensitivity.R: *Code for generating figures of our sensitivity analyses* \|- 11_scatterplots_birds.R: *Code for generating scatter plots* ## Sharing/Access information Network data were derived from the following source: * \[[https://doi.org/10.5061/dryad.mcvdnck4d](https://doi.org/10.5061/dryad.mcvdnck4d)]