AimMetacommunities are assembled through a combination of local and regional processes, with the relative importance of the drivers of assembly depending on ecological context. Global change can alter community assembly at both local and regional levels, potentially shifting communities into disequilibrium with their local environmental conditions. In this study, we evaluated the spatial variation in environmental filtering and habitat matching of 1078 riverine macroinvertebrate communities distributed across nine ecoregions within the conterminous United States.LocationConterminous United States.TaxonFreshwater macroinvertebrates.MethodsWe first quantified spatial patterns in environmental filtering, habitat matching, and functional trait diversity. We then used boosted regression trees to identify (1) functional trait predictors of environmental filtering and habitat match and (2) environmental, landscape, and network variables that predict functional trait abundances.ResultsOur results demonstrated that environmental filtering but not habitat matching varied strongly by ecoregion. We also found that functional trait diversity varied by ecoregion, but not as strongly as the signatures of environmental filtering. We did not identify consistent functional trait predictors for both environmental filtering and habitat matching, with trait predictors instead varying by individual traits, trait categories, and ecoregions. Notwithstanding inconsistent trait predictors, environmental filtering was primarily influenced by habitat preference traits while habitat matching was primarily influenced by both habitat preference and dispersal traits. Predictors of functional traits also varied by trait category and ecoregion, with habitat preference and dispersal traits primarily influenced by network variables.Main conclusionsOur study demonstrates the contingent patterns and drivers of environmental filtering and habitat matching on a macroecological scale. We aim for this work to provide the foundation on which trait-environment relationships can be further quantified and causal explanations established in the context of community disequilibrium and applied to conservation and management of freshwater systems.