{'fraction_non_alphanumeric': 0.010810810810810811, 'fraction_numerical': 0.0, 'mean_word_length': 5.706521739130435, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
A Comparative Test for Divergent Adaptation: Inferring Speciation Drivers from Functional Trait Divergence

Ecological differentiation between lineages is widely considered to be an important driver of speciation, but support for this hypothesis is mainly derived from the detailed study of a select set of model species pairs. Mounting evidence from nonmodel taxa, meanwhile, suggests that speciation often occurs with minimal differentiation in ecology or ecomorphology, calling into question the true contribution of divergent adaptation to species richness in nature. To better understand divergent ecological adaptation and its role in speciation generally, researchers require a comparative approach that can distinguish its signature from alternative processes, such as drift and parallel selection, in data sets containing many species pairs. Here we introduce new statistical models of divergent adaptation in the continuous traits of paired lineages. In these models, ecomorphological characters diverge as two lineages adapt toward alternative phenotypic optima following their departure from a common ancestor. The absolute distance between optima measures the extent of divergent selection and provides a basis for interpretation. We encode the models in the new R package diverge and extend them to allow the distance between optima to vary across continuous and categorical variables. We test model performance using simulation and demonstrate model application using published data sets of trait divergence in birds and mammals. Our framework provides the first explicit test for signatures of divergent selection in trait divergence data sets, and it will enable empiricists from a wide range of fields to better understand the dynamics of divergent adaptation and its prevalence in nature beyond just our best-studied model systems.