functcomp: Functional Composition

Description Usage Arguments Details Value Note Author(s) References See Also Examples

Description

functcomp returns the functional composition of a set of communities, as measured by the community-level weighted means of trait values (CWM; e.g. Lavorel et al. 2008).

Usage

1
functcomp(x, a, CWM.type = c("dom", "all"), bin.num = NULL)

Arguments

x

matrix or data frame containing the functional traits. Traits can be numeric, ordered, or factor. Binary traits should be numeric and only contain 0 and 1. character traits will be converted to factor. For a given trait, species with NA are excluded.

a

matrix containing the abundances of the species in x (or presence-absence, i.e. 0 or 1). Rows are sites and species are columns. The number of species (columns) in a must match the number of species (rows) in x. In addition, the species labels in a and x must be identical and in the same order. NAs will be replaced by 0.

CWM.type

character string indicating how nominal, binary and ordinal traits should be handled. See ‘details’.

bin.num

vector indicating binary traits to be treated as continuous.

Details

functcomp computes the community-level weighted means of trait values for a set of communities (i.e. sites). For a continuous trait, CWM is the mean trait value of all species present in the community (after excluding species with NAs), weighted by their relative abundances.

For ordinal, nominal and binary traits, either the dominant class is returned (when CWM.type is "dom"), or the abundance of each individual class is returned (when CWM.type is "all").

The default behaviour of binary traits being treated as nominal traits can be over-ridden by specifying bin.num, in which case they are treated as numeric traits.

When CWM.type = "dom", if the maximum abundance value is shared between two or more classes, then one of these classes is randomly selected for CWM. Because species with NAs for a given trait are excluded for that trait, it is possible that when CWM.type is set to "all", the sum of the abundances of all classes for a given ordinal/nominal/binary trait does not equal the sum of the species abundances. Thus, it is definitely not recommended to have NAs for very abundant species, as this will lead to biased estimates of functional composition.

Value

a data frame containing the CWM values of each trait for each community.

Note

functcomp is implemented in dbFD and will be returned if calc.CWM is TRUE.

Author(s)

Etienne Laliberté etiennelaliberte@gmail.com http://www.elaliberte.info

References

Lavorel, S., K. Grigulis, S. McIntyre, N. S. G. Williams, D. Garden, J. Dorrough, S. Berman, F. Quétier, A. Thébault and A. Bonis (2008) Assessing functional diversity in the field - methodology matters! Functional Ecology 22:134-147.

See Also

dbFD for measuring distance-based multidimensional functional diversity indices, including CWM.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# for ordinal, nominal and binary variables
# returns only the most frequent class
ex1 <- functcomp(dummy$trait, dummy$abun)
ex1

# returns the frequencies of each class
ex2 <- functcomp(dummy$trait, dummy$abun, CWM.type = "all")
ex2

# example with real data from New Zealand short-tussock grasslands
ex3 <- functcomp(tussock$trait, tussock$abun)
ex3

Example output

Loading required package: ade4
Loading required package: ape
Loading required package: geometry
Loading required package: magic
Loading required package: abind
Loading required package: vegan
Loading required package: permute
Loading required package: lattice
This is vegan 2.5-3
          num1     num2 fac1 fac2 ord1 ord2 bin1 bin2
com1  5.887500 4.037500    C    X    2    6    0    1
com2  4.212500 5.562500    B    Z    1    3    0    1
com3  5.716667 6.166667    A    Z    1    3    0    1
com4  9.000000 2.575000    C    Y    5    3    1    1
com5  4.500000 3.050000    C    Z    2    6    0    0
com6  5.095238 5.528571    C    Z    2    1    0    1
com7  7.009091 5.427273    A    Z    1    1    0    1
com8  5.245455 3.572727    C    X    2    6    1    0
com9  6.870000 4.245455    A    X    3    2    0    1
com10 7.427273 3.783333    B    X    3    2    1    0
          num1     num2    fac1_A     fac1_B     fac1_C    fac2_X     fac2_Y
com1  5.887500 4.037500 0.2500000 0.00000000 0.75000000 0.6250000 0.25000000
com2  4.212500 5.562500 0.0000000 0.25000000 0.12500000 0.1250000 0.00000000
com3  5.716667 6.166667 0.3333333 0.00000000 0.16666667 0.3333333 0.16666667
com4  9.000000 2.575000 0.1250000 0.00000000 0.87500000 0.1250000 0.87500000
com5  4.500000 3.050000 0.0000000 0.37500000 0.62500000 0.3750000 0.25000000
com6  5.095238 5.528571 0.1428571 0.04761905 0.52380952 0.2857143 0.28571429
com7  7.009091 5.427273 0.7272727 0.27272727 0.00000000 0.2727273 0.00000000
com8  5.245455 3.572727 0.0000000 0.09090909 0.72727273 0.6363636 0.18181818
com9  6.870000 4.245455 0.4545455 0.45454545 0.09090909 0.5454545 0.09090909
com10 7.427273 3.783333 0.3333333 0.50000000 0.08333333 0.5000000 0.08333333
         fac2_Z     ord1_1    ord1_2     ord1_3     ord1_5     ord2_1
com1  0.1250000 0.00000000 0.7500000 0.12500000 0.00000000 0.37500000
com2  0.8750000 0.87500000 0.1250000 0.00000000 0.00000000 0.00000000
com3  0.5000000 0.50000000 0.1666667 0.33333333 0.00000000 0.16666667
com4  0.0000000 0.00000000 0.0000000 0.12500000 0.87500000 0.00000000
com5  0.3750000 0.37500000 0.3750000 0.00000000 0.25000000 0.00000000
com6  0.4285714 0.28571429 0.5238095 0.04761905 0.00000000 0.42857143
com7  0.7272727 0.27272727 0.0000000 0.27272727 0.00000000 0.45454545
com8  0.1818182 0.18181818 0.7272727 0.09090909 0.00000000 0.18181818
com9  0.3636364 0.27272727 0.0000000 0.54545455 0.09090909 0.09090909
com10 0.4166667 0.08333333 0.0000000 0.50000000 0.08333333 0.33333333
          ord2_2     ord2_3    ord2_6    ord2_7    bin1_0    bin1_1    bin2_0
com1  0.12500000 0.00000000 0.5000000 0.0000000 0.2500000 0.2500000 0.5000000
com2  0.00000000 0.62500000 0.1250000 0.2500000 0.8750000 0.0000000 0.3750000
com3  0.33333333 0.50000000 0.0000000 0.0000000 0.8333333 0.1666667 0.0000000
com4  0.12500000 0.87500000 0.0000000 0.0000000 0.1250000 0.8750000 0.0000000
com5  0.00000000 0.25000000 0.3750000 0.3750000 0.3750000 0.2500000 0.7500000
com6  0.04761905 0.28571429 0.2380952 0.0000000 0.4285714 0.3333333 0.2857143
com7  0.27272727 0.00000000 0.0000000 0.2727273 1.0000000 0.0000000 0.2727273
com8  0.09090909 0.18181818 0.5454545 0.0000000 0.1818182 0.2727273 0.6363636
com9  0.54545455 0.09090909 0.0000000 0.2727273 0.7272727 0.2727273 0.4545455
com10 0.50000000 0.16666667 0.0000000 0.0000000 0.4166667 0.5833333 0.5000000
         bin2_1
com1  0.5000000
com2  0.6250000
com3  1.0000000
com4  1.0000000
com5  0.2500000
com6  0.7142857
com7  0.7272727
com8  0.3636364
com9  0.5454545
com10 0.5000000
       growthform     height     LDMC    leafN     leafP     leafS      SLA
Pen1  Short basal 0.22550027 266.5744 2.982052 0.2693179 0.1792133 19.21037
Pen2      Tussock 0.23388904 275.3226 2.910791 0.2588405 0.1755844 18.58016
Pen5  Short basal 0.18358152 238.4436 3.373699 0.2786069 0.1957439 19.94627
Pen9  Short basal 0.11235770 236.3566 2.948097 0.3138927 0.1861868 16.90408
Pen10 Short basal 0.10713433 238.1034 2.946824 0.3059686 0.1896386 17.43477
Pen11 Short basal 0.09462470 228.3570 3.039963 0.3237366 0.1913954 17.30223
Pen14 Short basal 0.04537999 298.6733 2.350886 0.2586631 0.1707718 11.52022
Pen17 Short basal 0.07212339 316.8398 2.217542 0.2377125 0.1646110 10.98069
Pen18 Short basal 0.17234681 323.1328 2.086162 0.2414245 0.1430168 11.91904
Pen21     Tussock 0.37104801 272.2978 3.050987 0.2679587 0.1865348 19.59199
Pen22 Short basal 0.21797348 253.1505 3.084255 0.2865835 0.1897410 18.76378
Pen23 Short basal 0.15263926 241.7774 3.194352 0.2948035 0.1918666 18.45776
Pen27 Short basal 0.15348891 254.7854 3.019657 0.2836981 0.1868589 18.07543
Pen28 Short basal 0.21968999 269.5619 2.936400 0.2726354 0.1858868 19.28186
Pen29     Tussock 0.51220753 309.7140 2.619142 0.2554523 0.1754166 20.45589
Pen32     Tussock 0.22355893 285.4528 2.766417 0.2528707 0.1696894 18.03013
Pen33  Semi basal 0.21223077 275.7188 2.955433 0.2614084 0.1830263 19.07397
Pen34 Short basal 0.18114627 223.3089 3.539941 0.2853488 0.2031483 20.78566
Pen37 Short basal 0.23452094 247.8365 3.196825 0.2547849 0.1930508 19.92797
Pen40 Short basal 0.18968409 239.9846 3.167286 0.2706361 0.1942665 19.19602
Pen41  Semi basal 0.30131667 235.6397 3.348570 0.2601549 0.1960331 18.93111
Pen44     Tussock 0.43243486 278.0831 2.965366 0.2638953 0.1823990 19.81887
Pen45 Short basal 0.29468644 257.4722 3.226275 0.2691094 0.1920146 20.02505
Pen46 Short basal 0.27233374 245.6731 3.266729 0.2662900 0.1935862 20.21913
Pen49 Short basal 0.04107733 301.0403 2.220539 0.2641510 0.1581757 12.83815
Pen52     Tussock 0.17308302 286.8042 2.375140 0.2721937 0.1588020 16.09756
Pen53 Short basal 0.18896522 267.1477 2.632226 0.2870069 0.1699806 15.98552
Pen56     Tussock 0.29544289 268.1038 3.044204 0.2640712 0.1837816 18.76710
Pen57  Semi basal 0.22360566 274.9918 2.904850 0.2613250 0.1846699 19.16702
Pen58  Semi basal 0.21969662 255.0929 3.186495 0.2667064 0.1921073 19.61846
      nutrientuptake       raunkiaer          clonality  leafsize dispersal
Pen1    Mycorrhizal  Hemicryptophyte Clonal belowground  833.5765   Passive
Pen2    Mycorrhizal  Hemicryptophyte Clonal belowground  741.3595   Passive
Pen5  Nitrogen fixer Hemicryptophyte Clonal belowground 1065.8780   Passive
Pen9    Mycorrhizal  Hemicryptophyte Clonal aboveground  565.0344   Passive
Pen10   Mycorrhizal  Hemicryptophyte Clonal aboveground  582.2508      Wind
Pen11   Mycorrhizal  Hemicryptophyte Clonal aboveground  646.3064      Wind
Pen14   Mycorrhizal  Hemicryptophyte Clonal belowground  180.4017   Passive
Pen17   Mycorrhizal  Hemicryptophyte Clonal belowground  102.4132   Passive
Pen18   Mycorrhizal  Hemicryptophyte               None  119.9334   Passive
Pen21   Mycorrhizal  Hemicryptophyte Clonal belowground 1464.5002   Passive
Pen22   Mycorrhizal  Hemicryptophyte Clonal belowground 1059.9135   Passive
Pen23   Mycorrhizal  Hemicryptophyte Clonal belowground  880.2519   Passive
Pen27   Mycorrhizal  Hemicryptophyte Clonal belowground  952.0681   Passive
Pen28   Mycorrhizal  Hemicryptophyte Clonal belowground  688.1559   Passive
Pen29   Mycorrhizal  Hemicryptophyte Clonal belowground  794.9705   Passive
Pen32   Mycorrhizal  Hemicryptophyte Clonal belowground  606.7874   Passive
Pen33   Mycorrhizal  Hemicryptophyte Clonal belowground  743.5933   Passive
Pen34 Nitrogen fixer Hemicryptophyte Clonal belowground 1188.3297   Passive
Pen37   Mycorrhizal  Hemicryptophyte Clonal belowground 1008.8745   Passive
Pen40   Mycorrhizal  Hemicryptophyte Clonal belowground 1175.7901   Passive
Pen41   Mycorrhizal  Hemicryptophyte               None 2750.5578   Passive
Pen44   Mycorrhizal  Hemicryptophyte Clonal belowground 1449.7046   Passive
Pen45   Mycorrhizal  Hemicryptophyte Clonal belowground 1088.1421   Passive
Pen46 Nitrogen fixer Hemicryptophyte Clonal belowground 1087.9923   Passive
Pen49   Mycorrhizal  Hemicryptophyte Clonal aboveground  176.7019      Wind
Pen52   Mycorrhizal  Hemicryptophyte Clonal belowground  407.9720   Passive
Pen53   Mycorrhizal  Hemicryptophyte Clonal belowground 1207.6105   Passive
Pen56   Mycorrhizal  Hemicryptophyte Clonal belowground 1580.7491   Passive
Pen57   Mycorrhizal  Hemicryptophyte Clonal belowground  709.6595   Passive
Pen58   Mycorrhizal  Hemicryptophyte Clonal belowground 1206.0823   Passive
       seedmass resprouting        pollination  lifespan
Pen1  1.0759521         Yes               Wind Perennial
Pen2  1.0569202         Yes               Wind Perennial
Pen5  1.0772984         Yes Hymenoptera (bees) Perennial
Pen9  0.6655591         Yes Hymenoptera (bees) Perennial
Pen10 0.8869401         Yes Hymenoptera (bees) Perennial
Pen11 0.8893498         Yes Hymenoptera (bees) Perennial
Pen14 0.7920503         Yes               Wind Perennial
Pen17 0.5431650         Yes               Wind Perennial
Pen18 0.7342561         Yes               Wind Perennial
Pen21 3.4193237         Yes               Wind Perennial
Pen22 1.8932444         Yes Hymenoptera (bees) Perennial
Pen23 1.1612677         Yes Hymenoptera (bees) Perennial
Pen27 1.6884329         Yes Hymenoptera (bees) Perennial
Pen28 1.0527719         Yes               Wind Perennial
Pen29 2.6308433         Yes               Wind Perennial
Pen32 0.9325491         Yes               Wind Perennial
Pen33 0.7795153         Yes               Wind Perennial
Pen34 1.1424924         Yes Hymenoptera (bees) Perennial
Pen37 1.6885935         Yes               Wind Perennial
Pen40 2.2187796         Yes Hymenoptera (bees) Perennial
Pen41 6.5872996         Yes               Wind Perennial
Pen44 3.7801505         Yes               Wind Perennial
Pen45 1.9444247         Yes               Wind Perennial
Pen46 1.9310994         Yes               Wind Perennial
Pen49 2.4532134         Yes Hymenoptera (bees) Perennial
Pen52 1.1140232         Yes               Wind Perennial
Pen53 3.3076543         Yes               Wind Perennial
Pen56 3.5225896         Yes               Wind Perennial
Pen57 0.9226121         Yes               Wind Perennial
Pen58 2.0853363         Yes               Wind Perennial

FD documentation built on May 2, 2019, 6:08 p.m.