Package Select. May 11, 2018

Similar documents
Package polypoly. R topics documented: May 27, 2017

Package Tcomp. June 6, 2018

Package funrar. March 5, 2018

Package RTransferEntropy

Package SK. May 16, 2018

Package aspi. R topics documented: September 20, 2016

Package RSwissMaps. October 3, 2017

Package kgc. December 21, Version Date Title Koeppen-Geiger Climatic Zones

Package depth.plot. December 20, 2015

Package leiv. R topics documented: February 20, Version Type Package

Package robustrao. August 14, 2017

Package varband. November 7, 2016

Package rnmf. February 20, 2015

Package mpmcorrelogram

Package netdep. July 10, 2018

Package gwqs. R topics documented: May 7, Type Package. Title Generalized Weighted Quantile Sum Regression. Version 1.1.0

Package gtheory. October 30, 2016

Package chemcal. July 17, 2018

Package multivariance

Package hierdiversity

Package gk. R topics documented: February 4, Type Package Title g-and-k and g-and-h Distribution Functions Version 0.5.

Package rdefra. March 20, 2017

Package weathercan. July 5, 2018

Package sscor. January 28, 2016

Package womblr. September 12, 2017

Package Rarity. December 23, 2016

Package beam. May 3, 2018

Package Perc. R topics documented: December 5, Type Package

Package MPkn. May 7, 2018

Package msu. September 30, 2017

Package MTA. R topics documented: May 14, Title Multiscalar Territorial Analysis Version 0.1.2

Package bigtime. November 9, 2017

Package EMVS. April 24, 2018

Package effectfusion

Package reinforcedpred

Package AID. R topics documented: November 10, Type Package Title Box-Cox Power Transformation Version 2.3 Date Depends R (>= 2.15.

Package invgamma. May 7, 2017

Package cellscape. October 15, 2018

Package TwoStepCLogit

Package face. January 19, 2018

Package BGGE. August 10, 2018

Package scpdsi. November 18, 2018

Package flowmap. October 8, 2018

Package HIMA. November 8, 2017

Package RATest. November 30, Type Package Title Randomization Tests

Package G2Sd. R topics documented: December 7, Type Package

Package idmtpreg. February 27, 2018

Package matrixnormal

Package platetools. R topics documented: June 25, Title Tools and Plots for Multi-Well Plates Version 0.1.1

Package cvequality. March 31, 2018

Package covsep. May 6, 2018

Package sbgcop. May 29, 2018

Package supernova. February 23, 2018

Package nardl. R topics documented: May 7, Type Package

Package PeriodicTable

Package KMgene. November 22, 2017

Package testassay. November 29, 2016

Package CEC. R topics documented: August 29, Title Cross-Entropy Clustering Version Date

Package noncompliance

Package pearson7. June 22, 2016

Package IMMAN. May 3, 2018

Package NonpModelCheck

Package msir. R topics documented: April 7, Type Package Version Date Title Model-Based Sliced Inverse Regression

Package OGI. December 20, 2017

Package FinCovRegularization

Package rgabriel. February 20, 2015

Package esaddle. R topics documented: January 9, 2017

Package camsrad. November 30, 2016

Package MicroMacroMultilevel

Package gambin. July 12, 2018

Package SMFilter. December 12, 2018

Package MonoPoly. December 20, 2017

Package clogitboost. R topics documented: December 21, 2015

Package BayesTreePrior

Package gma. September 19, 2017

Package timelines. August 29, 2016

Package stability. R topics documented: August 23, Type Package

Package BNN. February 2, 2018

Package RootsExtremaInflections

Package spthin. February 20, 2015

Package countyweather

Package OUwie. August 29, 2013

Package SpatialPack. March 20, 2018

Package nowcasting. April 25, Type Package

Package photobiologylamps

Package neuralnet. August 16, 2016

Package lomb. February 20, 2015

Package tspi. August 7, 2017

Package misctools. November 25, 2016

Package bhrcr. November 12, 2018

Package goftest. R topics documented: April 3, Type Package

Package elhmc. R topics documented: July 4, Type Package

Package ShrinkCovMat

Package solrad. November 5, 2018

Package velociraptr. February 15, 2017

Package jmcm. November 25, 2017

Package dominanceanalysis

Package darts. February 19, 2015

Package survidinri. February 20, 2015

Package BayesNI. February 19, 2015

Transcription:

Package Select May 11, 2018 Title Determines Species Probabilities Based on Functional Traits Version 1.4 The objective of these functions is to derive a species assemblage that satisfies a functional trait profile. Restoring resilient ecosystems requires a flexible framework for selecting assemblages that are based on the functional traits of species. However, current trait-based models have been limited to algorithms that can only select species by optimising specific trait values, and could not elegantly accommodate the common desire among restoration ecologists to produce functionally diverse assemblages. We have solved this problem by applying a non-linear optimisation algorithm that optimises Rao Q, a closed-form functional trait diversity index that incorporates species abundances, subject to other linear constraints. This framework generalises previous models that only optimised the entropy of the community, and can optimise both functional diversity and entropy simultaneously. This package can also be used to generate experimental assemblages to test the effects of community-level traits on community dynamics and ecosystem function. The method is based on theory discussed in Laughlin (2014, Ecology Letters) <doi.org/10.1111/ele.12288>. Depends R (>= 3.3.0) Imports Rsolnp, latticeextra, grdevices, stats, lattice, graphics, ade4, FD License GPL (>= 2) Encoding UTF-8 LazyData true RoxygenNote 6.0.1 Suggests knitr, rmarkdown, testthat VignetteBuilder knitr NeedsCompilation no Author Daniel Laughlin [cre, aut], Loic Chalmandrier [aut] Maintainer Daniel Laughlin <danielclaughlin@gmail.com> Repository CRAN Date/Publication 2018-05-11 16:23:03 UTC 1

2 pineforest R topics documented: pineforest.......................................... 2 plotprobs.......................................... 3 Select............................................ 4 selectspecies........................................ 5 serpentine.......................................... 7 tropicalforest........................................ 8 Index 9 pineforest Functional trait data for understory species in ponderosa pine forest A dataset containing two traits for species in a pine forest. The variables are as follows: data(pineforest) Format dataframe of 46 species and 2 traits Details species. species name flrdate. average flowering date in day of year leafcn. average leaf carbon-to-nitrogen ratio Source Laughlin, D.C., J.J. Leppert, M.M. Moore, and C.H. Sieg. 2010. A multi-trait test of the leafheight-seed plant strategy scheme with 133 species from a pine forest flora. Functional Ecology 24:493-501.

plotprobs 3 plotprobs Plots results from the selectspecies function This function plots results (species probabilities/optimum solutions) from the selectspecies() function plotprobs(result, traits, colors = c("lightblue", "blue"), xlim = NULL, ylim = NULL, xlab = NULL, ylab = NULL, zlab = "Probability", distance = 0.3, cex.lab = 1.5, box.col = "transparent", xbase = 0.5, ybase = 0.5,...) Arguments result traits colors xlim ylim xlab ylab zlab distance A saved object from function selectspecies() A matrix of trait values where traits are columns and rows are species. If one trait is provided, then the function creates a 2D barplot of probabilities for each species. If two traits are provided, then the function creates a 3D barplot that illustrates probabilities of species located within a 2D trait space. An optional vector of colors for plotting that must include at least two valid color names. The default color scheme is a ramp palette of lightblue to blue. Vector of two numbers denoting limits on x-axis. Vector of two numbers denoting limits on y-axis. Character string to describe x-axis. Character string to describe y-axis. Character string to describe z-axis. The default axis names is "Probabilities". An optional number denoting distance between bars in 3d plot. cex.lab An optional number denoting the size of the labels. The default is set to 1.5. box.col xbase ybase An optional setting for the color of the box. The default setting is transparent. The length of the base of each 3d bar along the x-axis The length of the base of each 3d bar along the y-axis... Additional arguments to pass to barplot() or lattice::cloud() Value 2D barplot of probabilities for each species or 3D barplot that illustrates probabilities of species located within a 2D trait space

4 Select Examples ### 1 trait constraint with maximum functional diversity and entropy Spp <- 5 #S = number of species trait <- as.matrix(data.frame(trait=c(1:spp))) rownames(trait) <- c(letters[1:nrow(trait)]) result1 <- selectspecies(t2c=trait, constraints=c(3.5), t2d=trait, obj="qh", capd=false) plotprobs(result1,trait, xlab="trait") ##### 2 traits: Constrain trait X to value 2.5, diversify trait Y traitx <- matrix(c(rep(1,3),rep(2,3),rep(3,3))) traity <- matrix(c(rep(c(1,2,3),3))) rownames(traitx) <- c(letters[1:9]); colnames(traitx) <- c("traitx") rownames(traity) <- c(letters[1:9]); colnames(traity) <- c("traity") result2 <- selectspecies(t2c=traitx,constraints=c(traitx=2.5),t2d=traity,capd=true,obj="qh") plotprobs(result2,traits = cbind(traitx, traity)) Select Select: Determines Species Probabilities Based on Functional Traits This package determines species probabilities (i.e., relative abundances) that satisfy a given functional trait profile. Restoring resilient ecosystems requires a flexible framework for selecting assemblages that are based on the functional traits of species. However, current trait-based models have been limited to algorithms that can only select species by optimising specific trait values, and could not elegantly accommodate the common desire among restoration ecologists to produce functionally diverse assemblages. We have solved this problem by applying a non-linear optimisation algorithm that optimises Rao Q, a closed-form functional trait diversity index that incorporates species abundances, subject to other linear constraints. This framework generalises previous models that only optimised the entropy of the community, and can optimise both functional diversity and entropy simultaneously. Details The Select package has two functions: Select functions The selectspecies() function is used to generate species assemblages (relative abundances/probabilities) based on a functional trait profile. The function can constrain the abundances to conform to certain average trait values, and it can simultanesouly optimize functional diveristy. The plotprobs() function plots the resulting species abundances (probabilities) using the resulting object from the selectspecies() function.

selectspecies 5 selectspecies Select species based on traits This function returns a probability distribution for a species pool based on their traits and a desired trait profile (Laughlin 2014). It can simultaneously constrain specific trait value(s) and optimise functional diversity. selectspecies(t2c = NULL, constraints = NULL, t2d, obj = c("qh", "Q", "H"), phi = 0.5, capd = FALSE, euclid = TRUE) Arguments t2c constraints t2d obj phi capd euclid "Traits to constrain": A matrix of species trait values, where species are organized as rows and traits as columns. These should be numeric arrays, and no missing values are tolerated. Ordinal data will yield meaningful results, but nominal data entered as numeric vectors are invalid. Row and column names are optional. This matrix can be any dimension, but the number of traits should be less than the number of species. Trait constraints: A vector of trait values that serve as constants in the constraint equations. If not specified, the function will not constrain solutions to trait means. These trait contraints must be listed in the same order as columns in t2c. These constraints are community-weighted mean trait values, i.e., average traits weighted by the relative abundance of each species. "Traits to diversify": Can be 1) a matrix of species trait values to diversify where species are organized as rows and traits as columns. NAs are tolerated as long as each pair of species can be compared by at least one trait. In this case, dissimilarities among species are computed using Euclidean distance. The number of species in t2d must match those in t2c. Or 2) a distance matrix of class dist that contains dissimilarities among species, no NAs are tolerated in the distance matrix. Objective function: The objective function to optimise, one of three possibilities = c("qh", "Q", "H"). QH = Quadratic entropy (Q) plus entropy (H ); Q = Quadratic entropy; H = entropy. A parameter bounded between 0 and 1 that weights the importance of either quadratic entropy or entropy (default = 0.5). Phi of 1 corresponds to 100 percent Q, phi of 0.5 corresponds to 50 percent Q and 50 perfect H, phi of 0 corresponds to 100 percent H. A logical stating whether the distance matrix should be capped at the mean distance among species (default = FALSE). Mean distance is calculated as the average of all upper triangular entries in the distance matrix calculated from t2d. A logical stating whether the distance matrix should be transformed to an Euclidean matrix if necessary (default = TRUE).

6 selectspecies Value A list with the elements: prob cwm_t2d cwm_t2c H Q objval lagrange hessian Probabilities, i.e. optimal solutions of species relative abundance Community-weighted mean trait values of resulting community for traits that were diversified, computed as probabilities x t2d using matrix multiplication Community-weighted mean trait values of resulting community for traits that were constrained, computed as probabilities x t2d using matrix multiplication Final entropy of community Final Rao Q of community Values of the objective function being maximized. The last value is the maximum. Lagrange multipliers. The Hessian at the optimal solution. References Laughlin, D.C. 2014. Applying trait-based models to achieve functional targets for theory-driven ecological restoration. Ecology Letters, 17, 771-784. Examples ### 1 trait constraint with maximum entropy Spp <- 5 #S = number of species trait <- as.matrix(data.frame(trait=c(1:spp))) rownames(trait) <- c(letters[1:nrow(trait)]) result1 <- selectspecies(t2c=trait, constraints=c(trait=3.5), t2d=trait, obj="h", capd=false) ### compare result1 with virtually identical maxent output from FD package #FD::maxent(constr=c(3.5),states=trait)$prob ### 1 trait constraint with maximum functional diversity result2 <- selectspecies(t2c=trait, constraints=c(trait=3.5), t2d=trait, obj="q", capd=false) ### 1 trait constraint with maximum functional diversity and entropy result3 <- selectspecies(t2c=trait, constraints=c(trait=3.5), t2d=trait, obj="qh", capd=false) ### Plot results plotprobs(result1,trait, xlab="trait") plotprobs(result2,trait, xlab="trait") plotprobs(result3,trait, xlab="trait") ### 1 trait and no trait constraint result4 <- selectspecies(t2d=trait, obj="qh", capd=false) plotprobs(result4,trait, xlab="trait") ##### 2 traits: Constrain trait X at X=3, diversify trait Y traitx <- matrix(c(rep(1,4),rep(2,4),rep(3,4),rep(4,4))) traity <- matrix(c(rep(c(1,2,3,4),4))) rownames(traitx) <- c(letters[1:16]); colnames(traitx) <- c("traitx") rownames(traity) <- c(letters[1:16]); colnames(traity) <- c("traity")

serpentine 7 result5 <- selectspecies(t2c=traitx,constraints=c(traitx=3),t2d=traity,obj="q",capd=false) result6 <- selectspecies(t2c=traitx,constraints=c(traitx=3),t2d=traity,obj="qh",capd=true) trait.matrix <- cbind(traitx, traity) plotprobs(result5,trait.matrix) plotprobs(result6,trait.matrix) ##### 3 traits: Constrain trait Z to value 2.5, diversify trait X and Y traitz <- as.matrix(data.frame(c(1,3,2,2,3,1,2,3,1,2,1,3,2,3,2,2))) rownames(traitz) <- c(letters[1:16]); colnames(traitz) <- c("traitz") result7 <- selectspecies(t2c=traitz,constraints=c(traitz=2.5),t2d=trait.matrix, capd=true, obj="qh") plotprobs(result7,trait.matrix) serpentine Functional trait data for species in serpentine grassland A dataset containing two traits for species in a serpentine grassland. The variables are as follows: data(serpentine) Format dataframe of 48 species and 2 traits Details species. species name wue. average water use efficiency, rate of carbon assimilation per unit of water used rootdepth. average rooting depth in soil Source Funk, J.L. & Wolf, A.A. 2016. Testing the trait based community framework: Do functional traits predict competitive outcomes? Ecology 97:2206-2211.

8 tropicalforest tropicalforest Functional trait data for tree species in tropical forest Format Details Source A dataset containing two traits for species in a tropical forest. The variables are as follows: data(tropicalforest) dataframe of 41 species and 2 traits species. species name sla. specific leaf area wd. wood density McCarthy, James K. 2018. Predicting the diversity and functional composition of woody plant communities under climate change PhD Thesis, School of Biological Sciences, The University of Queensland. Advisor: Dr. John Dwyer. doi:10.14264/uql.2018.134

Index Topic datasets pineforest, 2 serpentine, 7 tropicalforest, 8 pineforest, 2 plotprobs, 3 Select, 4 Select-package (Select), 4 selectspecies, 5 serpentine, 7 tropicalforest, 8 9