Statistical analysis
To test whether in each case the network metrics deviated from the expected values and if there were differences between habitats and between seasons within each habitat, we used the swap algorithm (Dormann, Fründ, Blüthgen, & Gruber, 2009). The swap algorithm initially randomizes the network matrix using the Patefield algorithm (Patefield, 1981), then swaps the interactions while constraining for connectance. Thus, it produces network matrices with the same connectance and marginal totals as the original matrix, but produces networks that are more specialized than other algorithms for randomization as some swaps are more likely than others and increases the values of high-value cells (Artzy-Randrup & Stone, 2005; Dormann, Gruber, & Fründ, 2008). We followed Gotelli & Ulrich (2011) and choose swap web to randomize the network matrices because it is a more constrained null model, which are better to avoid type I error. More constrained null models are more parsimonious and conservative in testing the hypothesis when the information comes only from the occurrence matrix (Gotelli & Ulrich, 2012). In order to determine the sampling completeness of our networks and the proportion of the total arthropod species richness present in bat diets that have been sampled, we used the Chao 1 index according to the method proposed by Macgregor, Evans, & Pocock (2017) for the networks, and individual based rarefaction curves for the estimation of each bat species diet.
We generated 1,000 random matrices with the same total marginal sum and connectance as the observed networks, and we used the Monte Carlo procedure (α= 5%) to check if the observed network metric value was higher or lower than expected by chance. To assess whether network structure differed between between seasons within each forest, and also between forest types across the whole year, for each comparison we calculated the difference in the observed metric values, and compared this to a null distribution of 1,000 differences obtained by Monte Carlo procedure. Due to the high calculation intensity of modularity QuanBiMo, we generated only 100 random matrices using the swap algorithm to calculate its significance.
In order to better understand the effects of habitat and seasonality on the composition and interactions of the network during the ENSO event, we used the R package betalink (Poisot, Canard, Mouillot et al. 2012) and calculated the dissimilarity of interaction matrices between habitats and between seasons within each habitat. The values for network dissimilarities were calculated based on the dissimilarity in the species composition of communities in the networks (βS), based on the differences in the interactions observed between species common to both networks (βOS), based only on differences in the interactions between both networks (βWN) and based on the dissimilarity of the interaction structure that was induced by the dissimilarity in species composition (βST) (Poisot et al. 2012). In order to determine the sampling completeness of our networks and the proportion of the total plant species richness present in bat diets that have been sampled, we used the Chao 1 index according to the method proposed by Macgregor et al. (2017) for the networks, and individual based rarefaction curves for the estimation of each bat species diet. All statistical analysis and network drawings were performed using R, version 3.3.2 (R Development Core Team, 2017).