cc-by-4.0Siqueira, TadeuBini, Luis M.JyrkÀnkallio-Mikkola, JennyLandeiro, Victor L.Melo, Adriano S.Pajunen, VirpiPetsch, Danielle K.Saito, Victor S.Silva, Thiago S. F.Tolonen, Kimmo T.Soininen, JanneHeino, Jani2025-03-242021-11-052021-11-05https://hydatakatalogi-test-24.it.helsinki.fi/handle/123456789/10190Updated version of the code. Data files are the same. This is the final version of the code, associated with a manuscript published in Ecology (doi: 10.1002/ecy.3014). A preprint is also available: https://www.biorxiv.org/content/10.1101/515098v1.abstract This is a unique dataset on insect communities sampled identically in a total of 200 streams in climatically highly different regions (100 in Brazil and 100 in Finland). The sampling design included 5 streams (communities) per watershed and provided us replicates of metacommunities (watersheds). Data also include information on in-stream variables (such as current velocity (m/s), depth (cm), stream width (cm), % of sand (0.25-2 mm), gravel (2-16 mm), pebble (16-64 mm), cobble (64-256 mm), and boulder (256-1024 mm), % of canopy cover by riparian vegetation, pH, conductivity, total nitrogen, and total phosphorus) and catchment level variables (such as average slope, % of native forest cover, pasture, agriculture, planted forests, urban areas, mining, water bodies, bare soil, secondary forest cover, and mixed land uses). In addition to the dataset, here we also provide and R code used to investigate the relationship between beta diversity and community size. This code calculates 4 types of beta-diversity metric for each of 100 watersheds (5 streams) in Brazil and Finland. Beta diversity: Sorensen and Bray-Curtis dissimilarity between all pairs. Beta deviation from null models: Raup-Crick (vegan version) and Bray-Curtis beta-deviation (based on the scripts by Chris Catano and Jonathan Myers). These beta diversity metrics are modelled against community size, environmental heterogeneity and spatial extent.   Openaquatic insects; beta deviation; community assembly; dispersal; metacommunities; null models; stochastic processesData and script: Community size can affect the signals of ecological drift and niche selection on biodiversitydataset