[R-sig-eco] Quantifying functional trait diversity through Gower distance and pcoa

Etienne Laliberté etiennelaliberte at gmail.com
Wed Nov 17 00:52:05 CET 2010


Dear Chris,

As Phil mentions, I initially wrote the FD library specifically to
accommodate this, so hope you find the library useful. As Jari says, you can
certainly achieve the same result by using functions like daisy() and
cmdscale() or dudi.pco() (in ade4), but my goal was to make this a bit
easier by automating the process and accommodating various scenarios. The
cost of this is that it makes the whole process less transparent, but I've
tried my best to describe in detail what is actually done in ?dbFD. dbFD
uses gowdis() and dudi.pco() for PCoA.

gowdis() is more flexible than daisy() in the 'cluster' package in that it
can take into account weights (in case you wanted to weigh traits
differently), and implements Podani's (1999) extension to ordinal variables.
A very flexible distance measure for measuring FD is dist.ktab() in ade4.

install.packages("FD", repos = "http://r-forge.r-project.org")
library(FD)
?gowdis # gower dissimilarity function
?dbFD # distance-based FD metrics

Phil mentions you can specify the number of dimensions, which is true, but
only for the functional richness (FRic) index. The reason being that this
index requires more species than traits. For other metrics, all dimensions
are used. When all traits are categorical, however, functional richness is
simply computed as the number of unique trait combinations in a community.

For example, if you only have categorical traits, here's a simple example:

library(FD)
?dbFD

# only categorical traits
traitcat <- dummy$trait[, 3:4]

# abundances
abun <- dummy$abun

# run example
test <- dbFD(traitcat, abun, corr = "cailliez", stand.FRic = FALSE)

More info can be found on the dbFD() help page. Please let me know if you
have further questions. Hope that helps.

Cheers

Etienne

-----Original Message-----
From: r-sig-ecology-bounces at r-project.org
[mailto:r-sig-ecology-bounces at r-project.org] On Behalf Of Phil
Novack-Gottshall
Sent: Tuesday, 16 November 2010 11:24 PM
To: chris mcowen
Cc: r-sig-ecology at r-project.org
Subject: Re: [R-sig-eco] Quantifying functional trait diversity through
Gower distance and pcoa

Dear Chris,

You might consider the FD library, which allows measurement of a range 
of functional diversity metrics, and includes functions for Gower 
distance (and, within other functions, PCoA, using, I believe, the 
dudi.pco function from the ade4 library).  A benefit of the library's 
functions is control over the number of dimensions to include.

Laliberté, E., and B. Shipley. 2010. FD: Measuring functional diversity 
(FD) from multiple traits, and other tools for functional ecology, 
Version 1.0-9.

Cheers,
Phil

On 11/16/2010 9:08 AM, chris mcowen wrote:
> Dear List,
>
> I am relatively new to this area of ecology and R, coming from a
> phylogenetic background. I am looking to quantify functional trait
> diversity in in order to plot global functional trait diversity
> hotspots. My trait data are categorical and all indicies of functional
> diversity require continuous data.
>
> My approach was to generate a distance matrix based on the Gower
> method - i have done this with vegdist- and then i was planning on
> running a pcoa on these to generate the continuous data to use in the
> calculation of functional diversity indicies.
>
> I have two questions:-
>
> First, does this make sense, i appreciate i will loose information this
way.
>
> Second, I have looked at vegan but can not see a way to run a pcoa on
> the output from a vegdist analysis, is this possible and once again
> does this make sense?
>
> Any help would be greatly appreciated,
>
> Chris
>
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>
>
>
>    

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           * PLEASE NOTE NEW CONTACT INFORMATION *

  Phil Novack-Gottshall
  Assistant Professor
  Department of Biology
  Benedictine University
  5700 College Road
  Lisle, IL 60532

  pnovack-gottshall at ben.edu
  Phone: 630-829-6514
  Fax: 630-829-6547
  Office: 332 Birck Hall
  Lab: 107 Birck Hall
  http://www.ben.edu/faculty/pnovack-gottshall

           * PLEASE NOTE NEW CONTACT INFORMATION *
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

_______________________________________________
R-sig-ecology mailing list
R-sig-ecology at r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology



More information about the R-sig-ecology mailing list