[R-sig-eco] error message with function rda of package vegan

Jari Oksanen jari.oksanen at oulu.fi
Tue Jun 12 10:34:52 CEST 2012


Howdy Folks,

I received the two data files from Duarte Viana, but I can't reproduce the problem: it runs smoothly in my computer.

resp<-read.table("resp.txt",header=F,sep="\t")
explan<-read.table("explan.txt",header=F,sep="\t")
library(vegan)
Loading required package: permute
This is vegan 2.1-16
 rda(resp, explan)
Call: rda(X = resp, Y = explan)

              Inertia Proportion Rank
Total          0.7156     1.0000     
Constrained    0.1654     0.2312    4
Unconstrained  0.5502     0.7688   83
Inertia is variance 

Eigenvalues for constrained axes:
   RDA1    RDA2    RDA3    RDA4 
0.08284 0.03875 0.02849 0.01534 

Eigenvalues for unconstrained axes:
    PC1     PC2     PC3     PC4     PC5     PC6     PC7     PC8 
0.04263 0.03916 0.03031 0.02678 0.02459 0.02294 0.02092 0.01955 
(Showed only 8 of all 83 unconstrained eigenvalues)

The problem seems not be reproducible in my PC (I can try Mac later).

About the error message you got: it seems to occur when the 'rank' of your solution is non-numeric (text). The 'rank' is found from the QR decomposition, and non-numeric 'rank' means that QR decomposition failed and returned something else than a real 'rank' (even NULL rank should give a different error message, and zero rank should be handled). I could not reproduce the problem so I have no idea how this would happen.

I need more details to reproduce the problem. 

The rda.default function (where this error seems to emanate) was last changed in October 2011, but that change should not influence this behaviour (but on the other hand, I cannot see how this behaviour arises). More directly related changes are from May 2011 which should be in the release 1.17-11 of June 2011. Are you are using a recent version of vegan? Have you checked your files after reading them?

Cheers, Jari Oksanen

Cheers, Jari Oksanen


________________________________________
From: r-sig-ecology-bounces at r-project.org [r-sig-ecology-bounces at r-project.org] on behalf of Duarte Viana [viana.sptd at gmail.com]
Sent: 11 June 2012 21:47
To: Sarah Goslee
Cc: r-sig-ecology at r-project.org
Subject: [R-sig-eco] error message with function rda of package vegan

Hi,

Thank you for your reply. It's not easy to give you a reproducible
example, because this is a very specific case (something in my data ,
I believe). The only way is to send the data and try yourself. If
someone is willing to do that, I would be grateful.

I can send the response matrix and the explanatory matrix, and all one
has to do is load library vegan, load the data, and run the rda
function:

library(vegan)

resp<-read.table("resp.txt", head=F, sep="\t")
expl<-read.table("expl.txt", head=F, sep="\t")

myrda<-rda(resp, expl)

Thanks,

Duarte



On Mon, Jun 11, 2012 at 6:42 PM, Sarah Goslee <sarah.goslee at gmail.com> wrote:
> Hi,
>
> On Mon, Jun 11, 2012 at 12:35 PM, Duarte Viana <viana.sptd at gmail.com> wrote:
>> Hello all,
>>
>> Apologies for cross postings.
>>
>> I am running the function "rda" of the vegan library, like I did many
>> times without having troubles, and I get the following error message:
>> "Error in if (rank) { : argument is not interpretable as logical".
>>
>> I am just testing a response matrix against a single explanatory
>> matrix, which is the result of a model matrix with 4 dummy variables
>> (coding for a factor of 5 levels).
>>
>> myrda<-rda(resp, expl)
>>
>> When I, for instance, change the response matrix, it goes well.
>>
>> Does anyone know what might be happening?
>
> Not without a reproducible example, I'm afraid.
>
> Sarah
>
> --
> Sarah Goslee
> http://www.functionaldiversity.org

_______________________________________________
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