DOI: 10.5061/dryad.02v6wwq7d
title: Data from: Inferring ecological selection from multidimensional community trait distributions along environmental gradients

description: Understanding the drivers of community assembly is critical for predicting
 the future of biodiversity and ecosystem services. Ecological selection
 ubiquitously shapes communities by selecting for individuals with most
 suitable trait combinations. Detecting selection types on key traits
 across environmental gradients and over time has the potential to reveal
 underlying abiotic and biotic drivers of community dynamics. Here we
 present a model-based predictive framework to quantify multidimensional
 trait distributions of communities (community trait niches), which we use
 to identify ecological selection types shaping communities along
 environmental gradients. We apply the framework to over 3600 boreal forest
 understory plant communities with results indicating that directional,
 stabilizing, and divergent selection all modify community trait niches and
 that the selection type acting on individual traits may change over time.
 Our results provide novel and rare empirical evidence for divergent
 selection within a natural system. Our approach provides a framework for
 identifying key traits under selection and facilitates the detection of
 processes underlying community dynamics.
description: Boreal forest understory species trait data, applied trait
 analysis code, and associated model outputs for reproducing the results in
 the manuscript "Inferring ecological selection from multidimensional
 community trait distributions along environmental gradients." Trait
 data include species-level mean trait values for ten functional traits
 (plant height, specific leaf area, leaf C:N ratio, leaf dry matter
 content, leaf P, leaf N, leaf N:P ratio, mycorrhizal status, clonality,
 and dispersal mechanism) for 39 vascular plant species located found in
 the understory of Finnish boreal forests. Model output from a multinomial
 Bayesian joint species distribution model is also provided yielding
 predictions of species relative abundance across 3,602 vegetation survey
 sites sampled in 1985-1986, 1995, and 2006 in conjunction with the 8th
 Finnish National Forest Inventory. Code is provided to process trait data,
 map predicted species relative abundance to traits, and construct
 multivariate trait distributions along enviromental gradients (soil
 fertility, growing degree days, and forest overstory density).
description: --- ## Code and data for inferring ecological selection from
 multidimensional community trait distributions along environmental
 gradients Boreal forest understory species trait data, applied trait
 analysis code, and associated model outputs for reproducing the results in
 the manuscript “Inferring ecological selection from multidimensional
 community trait distributions along environmental gradients.” Trait data
 include species-level mean trait values for ten functional traits (plant
 height, specific leaf area, leaf C:N ratio, leaf dry matter content, leaf
 P, leaf N, leaf N:P ratio, mycorrhizal status, clonality, and dispersal
 mechanism) for 39 vascular plant species located found in the understory
 of Finnish boreal forests. Model output from a multinomial Bayesian joint
 species distribution model is also provided yielding predictions of
 species relative abundance across 3,602 vegetation survey sites sampled in
 1985-1986, 1995, and 2006 in conjunction with the 8th Finnish National
 Forest Inventory. Code is provided to process trait data, map predicted
 species relative abundance to traits, and construct multivariate trait
 distributions along enviromental gradients (soil fertility, growing degree
 days, and forest overstory density). ## Description of the data and file
 structure ## Trait data Trait data is provided in a single comma-separated
 text file named “trait_dat.csv”. The rows of the data file correspond to
 species. The columns provide species-level mean trait values for the
 corresponding species. Metadata for each variable is provided below.
 Identifier variables * Species: Code for species (full species names are
 defined below) * AGROCAPI: Agrostis capillaris * BETUPUB3: Betula
 pubescens * CALAARUN: Calamagrostis arundinacea * CALLVULG: Calluna
 vulgaris * CAREDIGI: Carex digitata * CAREGLOB: Carex globularis *
 CONVMAJA: Convallaria majalis * DESCCESP: Deschampsia cespitosa *
 DESCFLEX: Deschampsia flexuosa * DRYOCART: Dryopteris carthusiana *
 EMPENIGR: Empetrum nigrum * EPILANGU: Epilobium angustifolium * EQUISYLV:
 Equisetum sylvaticum * FRAGVESC: Fragaria vesca * GYMNDRYO: Gymnocarpium
 dryopteris * JUNICOM3: Juniperus communis * LEDUPALU: Ledum palustre *
 LINNBORE: Linnaea borealis * LUZUPILO: Luzula pilosa * LYCOANNO:
 Lycopodium annotinum * MAIABIFO: Maianthemum bifolium * MELAPRAT:
 Melampyrum pratense * MELASYLV: Melampyrum sylvaticum * MELINUTA: Melica
 nutans * ORTHSECU: Orthilia secunda * OXALACET: Oxalis acetosella *
 PICEABI3: Picea abies * PINUSYL3: Pinus sylvestris * POPUTRE3: Populus
 tremula * PTERAQUI: Pteridium aquilinum * RUBUIDA4: Rubus idaeus *
 RUBUSAXA: Rubus saxatilis * SOLIVIRG: Solidago virgaurea * SORBAUC3:
 Sorbus aucuparia * TRIEEURO: Lysimachia europaea * VACCMYRT: Vaccinium
 myrtillus * VACCULIG: Vaccinium uliginosum * VACCVITI: Vaccinium
 vitis-idaea * VIOLRIVI: Viola riviniana Trait variables * Height_cm_TRY *
 SLA * Leaf_CN_ratio * LDMC * Leaf_P * Leaf_N * Leaf_NP_ratio * Myco_colo *
 Clonality * wind ## Model results Model results include 1,000 processed
 posterior samples from the multinomial Bayesian joint species distribution
 model described in the associated manuscript. Results are stored in a
 single R data file named “proc_mod_rslts.rda”. Posterior samples are
 provided for each parameter in the model as described below. See Itter et
 al., 2023 for complete definition of model and implementation details. *
 delta: Site-level factor used in Poisson approximation to multinomial
 response * beta: Species-specific environmental responses * gamma: Mean
 environmental responses among species * V: Variance of species-level
 responses to environment given a mean of gamma * sigma: Residual species
 standard deviation Code for processing and applying the trait data and
 model results in order to reproduce the analysis in the corresponding
 manuscript are described under Code/Software below. ## Sharing/Access
 information Data and code were derived from the following sources. *
 Itter, M.S., Kaarlejärvi, E., Laine, A.L., Hamberg, L., Tonteri, T. and
 Vanhatalo, J., 2022. Bayesian joint species distribution model selection
 for community-level prediction. bioRxiv, 2022.05.03.490480; doi:
 [https://doi.org/10.1101/2022.05.03.490480](https://doi.org/10.1101/2022.05.03.490480). ## Code/Software One R script file (“applied_trait_selection.R”) is provided to reproduce the analysis in the corresponding manuscript. The provided R script is described below. “applied_trait_selection.R”: R script file that loads the data file described above along with understory composition data, processes the data to generate inputs associated with the model described in the corresponding manuscript, demonstrates the implementation of the model including post-processing, and applies processed model results to reproduce all tables and figure in the corresponding manuscript.