key: cord-0289529-ism6hbrn authors: Wu, Naicheng; Guo, Kun; Zou, Yi; He, Fengzhi; Riis, Tenna title: SER: an R package to compute environmental regime over a certain time period date: 2022-03-21 journal: bioRxiv DOI: 10.1101/2022.03.19.485011 sha: 874e11cced5d5338c40f99bd5792d2d765f76ccf doc_id: 289529 cord_uid: ism6hbrn Environmental regime (or environmental legacy or historical legacy) is the environmental dynamic characteristics over a given (either long or short) time period, such as frequency of mean or extreme events and rate of change, which might be masked by using only contemporary variables. We present SER, an R package for estimating environmental regimes for different environmental variables. Using the data included in the package, several examples are shown. SER is suitable for any types of environmental variables e.g., nutrient concentration, light, dissolved oxygen. In addition, by changing the argument “days_bf”, it is possible to compute environmental regimes in any interested time period, such as days, months or years. Our case study showed that inclusion of environmental regimes dramatically increased the explained variation of temporal β-diversity and its components. Environmental regimes, particularly in a given time period, are expected to advance the “environment - community” relationships in ecological studies. In addition, they can be implemented in other subjects, e.g., social science, socioeconomics, epidemiology, with important applied implications. A sound understanding of environmentcommunity relations is a central topic in ecology. 44 Scientists have been endeavoring to find suitable environmental variables or indices that 45 have potential impacts on community compositions and distributions. Traditionally, 46 snapshot contemporary environmental variables that were collected simultaneously with 47 biological samples, such as in situ parameters, nutrient concentrations, are often employed. 48 However, this neglects the fact that biological community responds not only to 49 contemporary environmental condition but also to historic environmental (also called 50 historic legacy) characteristics ( Fig. 1) (Su et al. 2022) . For example, Oliveira, Lima-Junior 51 and Bini (2020) found that current environmental variables were weak predictors of fish 52 community structure, and that the predictive power substantially increased when using The utility of these historical environmental regime indices has resulted in tremendous 76 applications in ecological research and also other lines of research (e.g., Tonkin et al. 2018; 77 Nguyen et al. 2021; Torné s et al. 2021; De Pauw et al. 2022; Su et al. 2022; Xu et al. 2022) . However, there are several constraints to the currently used historical environmental 79 regime indices: 1) the current available indices are limited to hydroclimatic variables, such 80 as flow, temperature, precipitation. There is no available R package to calculate these 81 indices of other data such as pH, turbidity, dissolved oxygen, chlorophyll a, and other biotic 82 data (e.g., animal feeding or movement); 2) these indices are mostly based on long-term 83 intervals, e.g., 30 years for bioclimatic variables. Given that some organisms, particularly 84 microorganisms, may show quick responses to environmental changes, the aforementioned 85 indices might fail to link with biotic changes, and shorter time period may be more relevant. In addition, different organisms (e.g., algae, macroinvertebrates, fish, macrophytes, or even 87 terrestrial plants) have distinct extent of response to historical environmental regimes. For 88 instance, recent studies found that flow regimes over a short-term period (e.g., 7 or 14 days) 89 played a vital role in riverine algae and biofilm communities (Wu et al. 2018; Qu et al. Nevertheless, an R package or function that can be easily used to calculate short-term 112 environmental regime is still missing. (Table 1) Rate of change in a given time period (N). Temporal unit Numbers of events with rising change in a given time period if(!require(devtools)) install.packages("devtools") 142 devtools::install_github("https://github.com/kun-ecology/SER", build_vignettes= TRUE) 143 144 Example analyses 145 As an example, the embedded data are used to illustrate how SER works with discharge 146 data. By default, days between two successive sampling dates was used as the focal short- density for the 11 short-period hydrological indices described in Table 1 . diversity and its components ( Fig. 3 and 4) . Specifically, taxonomic total β-diversity, 202 turnover and nestedness increased by 3.0%, 4.9% and 15.5%, respectively, while functional 203 total β-diversity and its components increased by 13.3%, 4.6% and 12.2%, respectively. Interestingly, inclusion of flow regimes (i.e., Hyd+) played a less important role in 205 taxonomic temporal β-diversity than functional temporal β-diversity. In contrast, addition 206 of nutrient regimes (i.e., Nut+) explained more variations in taxonomic temporal β-207 diversity than functional temporal β-diversity (Fig. 3) . Regardless of the potential reasons, SER is an important tool to facilitate calculation of environmental regimes over a given 229 time period. As a holistic term, it is suitable for any types of environmental or biotic 230 parameters, such as nutrient concentration, pH, conductivity, light, dissolved oxygen, 231 chlorophyll a. Furthermore, by changing the argument "days_bf", it is possible to compute 232 environmental regime in any given time period, such as months or years, as long as the 233 records are measured in a corresponding manner. Being a completely open source tool, it's open for further extension and examination. We 235 envisage that SER is greatly helpful in both basic and applied ecological studies from 236 mesocosm experiments to field surveys. On one side, environmental regimes (e.g., thermal, 237 13 nutrient, flow), particularly short-term environmental regimes, can be robust variables in 238 understanding the "community-environment" relationships of different organisms in 239 various ecosystems (e.g., aquatic, forest, terrestrial ecosystems), being complementary 240 predictors for model simulation and prediction. A recent study found that severe changes 241 in the thermal regimes of Austrian rivers under climate change reinforced physiological 242 stress and supported the emergence of diseases for brown trout (Borgwardt et al. 2020) . On the other side, exploring responses of different organisms to environmental regimes 244 shifts can be used for management and policy making. For instance, by exploring the 245 relationships between the occurrence of cyanobacterial blooms and water-level regimes, 246 management of water-level can be a potential mitigation strategy for cyanobacterial blooms 247 (Bakker & Hilt 2016) . In addition, we would like to emphasize SER's potential in 248 experimental biology or mesocosm experiments, which often last for a relative short period 249 but could have high-frequency measured data, e.g., temperature, light. High-frequency data 250 (at 15-minute interval) of light and water temperature were measured in a microcosm study, 251 and the results indicated light and temperature emerged as significant variables on 252 phytoplankton community attributes (Wijewardene et al. 2021b ). To a broad extent, environmental regimes can be used in other subjects, e.g., social sciences, 254 socioeconomics, epidemiology. As an example, a recent study (Wu et al. 2022b) found that Altering temperature and rainfall regimes, such as unusually cool and wet spring, is 263 reducing global production of staples (e.g., rice, wheat), while, in contrast, some more Impact of water-level fluctuations on cyanobacterial blooms: 282 options for management Direct and Indirect Climate Change Impacts on Brown Trout in Central Europe How Thermal Regimes Reinforce Physiological Stress and Support the Emergence 286 of Diseases Automatic high-frequency 289 measurements of full soil greenhouse gas fluxes in a tropical forest Forest understorey communities respond 295 Epiphyton in Agricultural Streams: Structural Control and 341 Comparison to Epilithon Effects of the herbicides metazachlor and flufenacet on 344 phytoplankton communities -A microcosm assay Hydrological and environmental variables outperform spatial factors in structuring 348 species, trait composition, and beta diversity of pelagic algae Flow regimes filter species traits of benthic diatom communities and modify 352 the functional features of lowland streams -a nationwide scale study. Science of 353 The Total Environment Environment 355 regimes play an important role in structuring trait-and taxonomy-based temporal 356 beta diversity of riverine diatoms Fluctuating temperature modifies heat-mortality association in the globe Geographical 370 distribution of As-hyperaccumulator Pteris vittata in China: Environmental factors 371 and climate changes