
This Zenodo record contains all R scripts and workflow files used to reproduce the analyses presented in the manuscript “Stoichiometric responses of detritivores vs carnivores across Brazil.” The scripts implement the full analytical pipeline, including data preparation, stoichiometric trait modeling, multivariate niche analyses, and community- and richness-level summaries. The code is designed to be used together with the associated Dryad data package (survey_invertebrates.csv and survey_autotrophs.csv), available at DRYAD: DOI: 10.5061/dryad.rjdfn2zrd.Together, the Zenodo code archive and Dryad data archive enable full reproducibility of all analyses and figures. Contents The archive includes the following scripts: Lat_env_model_regressions.R — Multivariate compositional (ALR) models of elemental composition (C, N, P) along latitude, temperature, and algal N:P, including prediction, back-transformation, and coefficient extraction. Ellipses_2D.R — Generation of 2D stoichiometric niche ellipses (N–P, N–C, P–C) along environmental gradients using multivariate normal models. Hypervolume_niche_volume.R — Estimation of stoichiometric niche volume (generalized variance of ALR covariance matrices) along latitude, temperature, and algal N:P. Trophic_boxplots_CV_means.R — Tests and boxplots comparing elemental means and coefficients of variation between carnivores and detritivores at the site level. Community_composition_PERMANOVA.R — Bray–Curtis PERMANOVAs for family- and morphospecies-level community composition for detritivores and carnivores. Richness_vs_environment_stoich_subset.R — Morphospecies richness vs. latitude, MAT, and algal N:P using the stoichiometry-filtered subset. Summary_effects_plots.R — Compact effect-summary figures synthesizing model outputs for latitude, temperature, and algal N:P across all stoichiometric traits. A README PDF is included summarizing the purpose, inputs, workflow, and outputs of each script. Software Requirements All analyses require R (version ≥ 4.2) and the following packages: gamlss2 (from GitHub: gamlss-dev/gamlss2) bamlss ggplot2, patchwork, dplyr, tidyr, purrr, tibble, scales Matrix, MASS, vegan, car, cowplot, ragg The workflow assumes the data files (from Dryad) are placed in the working directory alongside the scripts. Reproducibility Running the scripts in numerical order (starting with Lat_env_model_regressions.R) fully reproduces all figures, tables, and summary statistics reported in the manuscript. No manual preprocessing is required beyond placing the CSV data files in the working directory.
Ecology, Animal ecology, FOS: Biological sciences
Ecology, Animal ecology, FOS: Biological sciences
| selected citations These citations are derived from selected sources. This is an alternative to the "Influence" indicator, which also reflects the overall/total impact of an article in the research community at large, based on the underlying citation network (diachronically). | 0 | |
| popularity This indicator reflects the "current" impact/attention (the "hype") of an article in the research community at large, based on the underlying citation network. | Average | |
| influence This indicator reflects the overall/total impact of an article in the research community at large, based on the underlying citation network (diachronically). | Average | |
| impulse This indicator reflects the initial momentum of an article directly after its publication, based on the underlying citation network. | Average |
