Drivers of species composition across beaches and levels
We first partitioned the variance in species composition due to geographical distances and to the environmental differences included in the previous models as predictors (Borcard et al., 1992; Peres-Neto et al., 2006), using the R package ade4 v. 1.7-19 (Dray & Dufour, 2007, Bougeard & Dray, 2018). Second, we investigated the relationship between species community composition and geographical distances using Mantel test for each separate beach level. Third, we quantified the effect of environmental variables on the community of proseriates using the function ‘manyglm’ in the R package mvabund v. 4.2.1 (Wang et al., 2022). Finally, to specifically address this hypothesis, we used an environment-by-trait fourth-corner interaction by analyses of deviance using the function ‘anova.traitglm’ included in the R package mvabund. Fourth-corner analyses fit a predictive model for species occurrence as a function of the environmental variables and the species traits. Since most of the functional traits were categorical, we applied a Gower dissimilarity transformation to the complete trait matrix and extracted orthogonal morphological axes through principal component analyses, which we then used to fit the model (Mammola & Cardoso, 2020). The selected axes accounted for 79% of the cumulative variance.