# Introduction

A central goal in ecology is to identify and understand the processes that influence the distributions of species in space and time. Often, these assembly processes are not directly observable over feasible time scales and must instead by inferred through pattern (Levin 1992). One increasingly popular approach is to use the values and abundances of species traits in a community as evidence for the influence of particular assembly processes (Cavender-Bares 2004, Ackerly 2007, Kraft 2008). Trait-based approaches have several advantages over strictly taxonomic approaches in that they are quantitative, easily generalizable, and have explicit ties to ecological strategy and performance (McGill 2006, Violle 2007).

Unfortunately, inferring process from community trait patterns is not always straightforward because different processes can lead to similar patterns, multiple processes can operate simultaneously on multiple traits, and patterns can be affected by exogenous forces. For example: community assembly is sometimes depicted as a balance between environmental filtering, in which species unable to tolerate environmental conditions are filtered out resulting in a clustering of trait values, and niche differentiation, in which competition and limiting similarity result in trait values that are more evenly spaced than expected by chance (Cavender-Bares 2004, Kraft 2007). But recent work has shown that environmentally-filtered communities can result in random or overdispersed trait patterns (e.g. when there is sufficient within-community environmental heterogeneity) (D’Andrea 2016), and competition-structured communities can result in clustering patterns (Mayfield 2010). In addition, pattern-based evidence of assembly processes can be obfuscated by propagule pressure from adjacent communities (Leibold 2004), or by fluctuating environmental conditions that favor different species over time (Chesson 1981, Chesson 1994).

Although it is unlikely that a single pattern-based test will ever provide incontrovertible evidence for niche differentiation, analysis of community trait structure can still shed light on assembly processes if used properly. Different metrics should be used in complementary ways to provide more detailed, and thus more interpretable characterizations of community trait structure. In one recent study, (D’Andrea ) suggest a stepwise analysis pipeline in which potential niches along trait axes are identified using a clustering algorithm, and if clusters are identified, then the fine-scale abundance structure within each cluster is examined for evidence of distance-based competition. Next, tests of community trait structure should be conducted along environmental gradients where they can potentially be tied to mechanistic predictions derived from existing ecological theory (Webb 2010). Lastly, analyses of community trait structure should be used to develop and select hypotheses for experimental testing in the field, rather than be considered as compelling standalone evidence.

Here, we apply a suite of newly developed and classical metrics of community trait structure to a network of twelve grasslands positioned along temperature and precipitation gradients in southern Norway. Our tests include measures of clustering, fine-scale trait abundance structure, and whole-community trait abundance structure. We look for community-level patterns in four traits: leaf area, maximum potential canopy height, seed mass, and specific leaf area (SLA). Based on our knowledge of the system, we predict a gradual shift in importance of competitive interactions at the coldest sites to environmental filtering at the most stressful sites. We expect that competition for light will be the strongest competitive factor at the warmest sites, and thus there will competition-derived clustering in maximum height and leaf area. We expect there to be niche differentiation in SLA at the coldest sites, where there could be a tradeoff between risky fast-growth strategies and the ability to tolerate/avoid early season frosts. Ultimately, our work uses trait-based predictions of community assembly processes to glean information about the relative influence of assembly mechanisms on grassland community composition.

# Methods

## Data

We measured four traits: leaf area (LFA), specific leaf area (SLA), maximum plant height (MXH), and seed mass (SDM). We standardize our traits by taking the logarithm of the trait value and rescaling the logarithms to range between 0 and 11. We applied our tests on each trait individually, as well as on the Euclidean space formed by these traits, which is a four-dimensional hypercube of side 1.

## Metrics

For each site we calculate its Rao quadratic entropy, defined as $$Q=\sum_i^{S-1}\sum_{j=i+1}^S d_{ij}p_i p_j$$, where $$p_i$$ and $$p_j$$ are the relative abundance of species $$i$$ and $$j$$, $$d_{ij}$$ is the absolute trait difference between them, and the sum is over all species pairs. It corresponds to the expected trait difference between two individuals randomly sampled (with replacement) from the community. We also used the functional dispersion metric proposed in (Laliberté 2010), defined as the abundance-weighted mean distance $$d_i$$ between each species $$i$$ and the community trait centroid. That is, $$\text{FDis}=\sum_i p_i d_i$$. When a single trait is considered, this is simply $$\sum_i p_i |x_i-\sum_j p_j x_j|$$, where $$x_i$$ is the trait value of species $$i$$. Both indices have been used to quantify community functional diversity (Botta-Dukát 2005, Laliberté 2010, Ricotta 2011). A high value indicates trait overdispersion, i.e. species cover a wider region of trait space than expected by chance. In contrast, a low value suggests that species are being filtered toward a particular trait value, possibly due to selection for optimal tolerance to local environmental conditions (Keddy 1992).

In addition to test statistics based on trait dispersion, we also used a measure of the degree of even spacing between adjacent species on the trait axis. The metric is defined as $$\text{CV}=\sigma/\mu$$, where $$\mu$$ and $$\sigma$$ are respectively the mean and standard deviation of the distances between closest neighbors in trait space. When a single trait is considered, species can be ordered by trait value, and the distance vector is $$d_i=|x_i-x_{i+1}|$$ between adjacent species $$i$$ and $$i+1$$. A low CV indicates even spacing. Even spacing has been proposed as indicative of niche differentiation, as it maximizes exploration of niche space (Mason 2005), and minimizes competitive interactions caused by trait similarity (MacArthur 1967). On the other hand, recent work has raised the possibility that resource partitioning may actually lead to species clustering on the trait axis (Scheffer 2006). In particular, clusters in trait space are expected if competitive exclusion is slow or if immigration replenishes species that are not niche-differentiated (D’Andrea 2016). Given this possibility, the coefficient of variation may actually be higher than expected by chance.

Although species may be clustered, they may still sort into niches that in turn are evenly spaced. This could occur if competition is caused by trait similarity (Scheffer 2006, D’Andrea ). In that case, the most abundant species in the community might be expected to be evenly spaced even though the community as a whole is clustered. Based on these considerations, we used the CV in two metrics. First, we considered all species in the community without regard for abundance. A similar test statistic, the variance divided by the range, is commonly used to quantify evenness (Stubbs 2004, Kraft 2008a, Ingram 2009). Second, we gradually remove species from the community in increasing order of abundance, at each step calculating the CV among the remaining species. If the CV declines as the least abundant species are progressively removed, this suggests even spacing between niches concomitant with clustering between species.

Finally, we test for the presence of clusters directly by applying a cluster-finding method. Our metric uses a k-medoid clustering algorithm, which partitions trait space into groups (clusters) of species, each group with a specific medoid, i.e. the species that is closest to all other members of its group. It is an iterative process which alternately decides cluster membership and medoid identity by minimizing the average distances in trait space between species and the medoids of their clusters (Rousseeuw 1990). We implement the algorithm using the function clara in R package cluster (Maechler 2016). For each community-year, we find the number of clusters that best fits the data using R’s optim function for Markov chain Monte Carlo optimization (R Core Team 2015). The quantity being optimized is the average silhouette width, a measure of how similar individuals are to their own cluster compared to neighboring clusters (Rousseeuw 1990). Once the optimal number of clusters is found, the test statistic is the optimized average silhouette width. We then test for clustering by comparing the test statistic against the set of null communities.

## Null model

In order to create null communities against which to compare our data, we used a mainland-island approach, where each site undergoes zero-sum birth-death neutral