[R] partial dbRDA or CCA with two distance objects in Vegan.

Jari Oksanen jari.oksanen at oulu.fi
Tue Sep 21 17:34:38 CEST 2010


On 21/09/10 17:40 PM, "Nevil Amos" <nevil.amos at gmail.com> wrote:

>   I am trying to use the cca/rda/capscale functions in vegan to analyse
> genetic distance data ( provided as a dist object calculated using
> dist.genpop in package adegenet) with geographic distance partialled out
> ( provided as a distance object using dist function in veganthis method
> is attempting to follow the method used by Geffen et al 2004  as
> suggested by Legendre and . FORTIN (2010).
> 
> I cannot see how to introduce the Conditioning ( partialled) second dist
> matrix.  as you can see from the code snippet below, the two dist
> objects are of the same dimensions. - I get an error using capscale:
>          Error in qr.fitted(Q, Xbar) :
>                'qr' and 'y' must have the same number of rows
> or cca
>          Error in weighted.mean.default(newX[, i], ...) :
>                 'x' and 'w' must have the same length
> when using a conditioning distance object instead of a variable (Clade)
> of the same length as  the constraints ( Latitude and Longitude)
> 
> I would be grateful, for any pointers on this, ie which test is the
> appropriate one to use ( I believe capscale since it is "similar to
> distance-based redundancy analysis (Legendre & Anderson 1999)") and
> whether this test is indeed equivalent to the approach suggested by
> Legendre &Fortin, (Geffen et al used DISTLM).
> 

Nevil,

You cannot use cca() for dissimilarity data. If you have dissimilarity data,
you must use capscale() which runs db-RDA. Even there, your constraints
(variables on the right hand side of the formula) must be rectangular data
and not dissimilarities. AFAIK, people have changed their dissimilarities
into a PCNM structure when they want to partial out the distance effect.
That is one of the few original possibilities since data must be rectangular
(rows and columns).

Cheers, jari oksanen



More information about the R-help mailing list