DOI: 10.6084/m9.figshare.14039504.v2
title: Tree Functional Trait Application Project v1

description: Tree Functional Trait Application Project v1.Corresponding authors:alain.paquette@gmail.combelluaumichael@gmail.com<br>Our dataset was originally created to offer scientists and the public a “ready-to-use” functional trait database for trees. This dataset is the first step within a larger project to create a standardized tree functional trait database for applied projects.<br>We aim to offer a clean and uniform database of traits with clear selection criteria for its retained values : that the trait value is original and can be traced back to a single publication (duplicates are removed); that the trait was measured on trees growing in their natural environment (not experimental); that measurement units are correct; that all remaining possible outliers are verified manually by going back to the original publication for confirmation.<br>The dataset consists (currently) of 207 tree species (based on the common species found in Montreal, Canada), of which 110 had values for all four traits. For the remaining species, 45 had only a single missing trait value and 52 had more than one missing trait value. In this first version of the database, we selected four functional traits commonly used in ecology, known for their biological and ecological importance with regards to ecological strategies : leaf nitrogen content, specific leaf area, seed mass, and wood density (Chave et al., 2009; Díaz et al., 2016; Reich, 2014; Wright et al., 2004). The data were obtained from the TRY database (Kattge et al., 2011), the Kew Seed Information Database, and from the literature, and were triaged to ensure that only values which matched our criteria (see above) were retained. <br>Data for these four traits, in addition to a further binary distinction between gymnosperms and angiosperms, were used for afunctional grouping analysis project on Montreal’s tree diversity. The aim of this project was to create functionally relevant species groups in order to improve functional diversity in urban areas. For this project, some data imputations were first performed to complete the dataset, adding trait values for the 45 species missing only a single value. Missing values for seed mass were calculated using the average seed mass of the genus. For the other three traits, missing values were calculated using the multivariate imputation by chained equations (MICE) procedure (Azur, Stuart, Frangakis, & Leaf, 2011). Note that other approaches can be used for filling-in missing values.<br>To calculate trait dissimilarity matrices, we used Gower’s distance for each pairwise combination of the 155 tree species in the dataset (110 complete species + 45 imputed species). We chose this distance metric because it can handle both quantitative and qualitative variables (Pavoine, Vallet, Dufour, Gachet, & Daniel, 2009). We then analyzed the dissimilarity matrices using an agglomerative hierarchical cluster analysis and Ward’s method. Hierarchical clustering examines the similarity between pairs of data points whereas the Ward D method seeks to minimize the within-cluster variance (in order to obtain the most homogeneous clusters possible) and, as a consequence, to maximize the between-cluster variation (in order to obtain the most dissimilar clusters) at each clustering stage. The cut-off for the number of clusters was determined by an average silhouette width analysis followed by a biological interpretation of the clusters. Four clusters (groups) of functionally distinct tree species were thus retained and three of these groups could then be divided into sub-groups, giving eight sub-groups (Figure B1). Again, other methods can be used to achieve functional groups.<br>An additional 52 species found in Montreal had two or three missing trait values (out of four) and could therefore not be included in the multivariate imputation method (due to the large uncertainty in the imputation method), so we proceeded differently for those species. Once the functional groups and sub-groups have been identified, it is possible to assign a group (or sub-group) to these species from a similarity analysis. Using a custom cosine similarity, modified to handle missing values, it is possible to calculate the similarity between a species and the different functional groups (or sub-groups). Since they are in different groups, gymnosperm and angiosperm similarities were calculated separately. We could therefore assign the group with the highest similarity to all remaining 52 species.<br>All calculations were performed in R version 3.5.2 (R Core Team, 2019) using the function mice from the mice package (van Buuren & Groothuis-Oudshoorn, 2011), the functions agnes, daisy and pam implemented within the cluster package (Maechler et al. 2019). The custom cosine function is provided below : <br>References<br>Azur, M. J., Stuart, E. A., Frangakis, C., & Leaf, P. J. (2011). Multiple imputation by chained equations: What is it and how does it work? International Journal of Methods in Psychiatric Research, 20(1), 40–49. https://doi.org/10.1002/mpr.329Chave, J., Coomes, D., Jansen, S., Lewis, S. L., Swenson, N. G., & Zanne, A. E. (2009). Towards a worldwide wood economics spectrum. Ecology Letters, 12(4), 351–366. https://doi.org/10.1111/j.1461-0248.2009.01285.xDíaz, S., Kattge, J., Cornelissen, J. H. C., Wright, I. J., Lavorel, S., Dray, S., … Gorné, L. D. (2016). The global spectrum of plant form and function. Nature, 529(7585), 167–171. https://doi.org/10.1038/nature16489Kattge, J., Díaz, S., Lavorel, S., Prentice, I. C., Leadley, P., Bönisch, G., … Wirth, C. (2011). TRY - a global database of plant traits. Global Change Biology, 17(9), 2905–2935. https://doi.org/10.1111/j.1365-2486.2011.02451.xPavoine, S., Vallet, J., Dufour, A. B., Gachet, S., & Daniel, H. (2009). On the challenge of treating various types of variables: Application for improving the measurement of functional diversity. Oikos, 118(3), 391–402. https://doi.org/10.1111/j.1600-0706.2008.16668.xR Core Team. (2019). R: A Language and Environment for Statistical Computing. Vienna, Austria: R Foundation for Statistical Computing. Retrieved from http://www.r-project.org/Reich, P. B. (2014). The world-wide “fast-slow” plant economics spectrum: A traits manifesto. Journal of Ecology, 102(2), 275–301. https://doi.org/10.1111/1365-2745.12211van Buuren, S., & Groothuis-Oudshoorn, K. (2011). mice: Multivariate imputation by chained equations in R. Journal of Statistical Software, 45(3), 1–67. https://doi.org/10.18637/jss.v045.i03Wright, I. J., Reich, P. B., Westoby, M., Ackerly, D. D., Baruch, Z., Bongers, F., … Villar, R. (2004). The worldwide leaf economics spectrum. Nature, 428(6985), 821–827. https://doi.org/10.1038/nature02403<br>R script<br># Define function (cosine_na) that perform cosine similarity, taken from package lsa and modified to handle missing values.cosine_na &lt;- function( x, y=NULL ){if ( is.matrix(x) && is.null(y) ) {co = array(0,c(ncol(x),ncol(x)))f = colnames( x )dimnames(co) = list(f,f)for (i in 2:ncol(x)) {for (j in 1:(i-1)) {co[i,j] = cosine_na(x[,i], x[,j])}}co = co + t(co)diag(co) = 1return (as.matrix(co))} else if ( is.vector(x) && is.vector(y) ) {return ( crossprod(x,y) / sqrt( crossprod(x)*crossprod(y) ) )} else {stop("argument mismatch. Either one matrix or two vectors needed as input.")}}# Define function (cosine_na2) that removes NA before calculating the similarity.cosine_na2 &lt;- function(x,y) cosine_na(na.omit(cbind(x,y)))# Define function (comp) that perform the pairwise comparisons between all species and functional groups (or sub-groups).i &lt;- outer(unique(assign_ssp$group),unique(assign_ssp$group),FUN=function(i,j) i)j &lt;- outer(unique(assign_ssp$group),unique(assign_ssp$group),FUN=function(i,j) j)i &lt;- i[!lower.tri(i)] ; j &lt;- j[!lower.tri(j)]comp &lt;- function(ind){res &lt;- cosine_na2(assign_ssp$value[assign_ssp$group==i[ind]], assign_ssp$value[assign_ssp$group==j[ind]])[1,2]list(No1=as.character(i[ind]),No2=as.character(j[ind]),CosSim=res)}res &lt;- t(apply(as.data.frame(t(sapply(seq_along(i),FUN="comp"))), 1, unlist))<br>