[R] partial dbRDA or CCA with two distance objects in Vegan.
Nevil Amos
nevil.amos at gmail.com
Tue Sep 21 18:34:52 CEST 2010
Thanks for that, just to confirm I therefore need to use:
#if
#geogdist is a geographic distance matrix
#gen_dist is a genetic distance matrix
#env_var are environmental variables
mypcnm<-pcnm(geogdist)
mydbRDA<-capscale(gen_dist~env_var+Condition(mypcnm$vectors))
cheers
Nevil
On 22/09/2010 1:34 AM, Jari Oksanen wrote:
> 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