[R-sig-eco] Problems with correspondence analysis in vegan

Jari Oksanen jari.oksanen at oulu.fi
Sun Feb 22 18:30:11 CET 2009


On 22/02/2009, at 19:11 PM, Manuel Spínola wrote:

> Dear list members,
>
> I am trying to run a correspondence analysis with cca function  
> (package: vegan).
> I got the following message:
>
> > ca1 = cca(roeesp)
> Error in data.frame(sitenv) :
> argument "sitenv" is missing, with no default
>
> Even I tried the example form the vegan tutorial and I got the same  
> message:
>
> cca(varespec)
> Error in data.frame(sitenv) :
> argument "sitenv" is missing, with no default
>
> I ran a PCA with rda function on the same data set (roeesp) and no  
> problem.

The problem is that you did not use vegan, but ade4. The cca function  
ade4 requires 'sitenv' function. The cca function in vegan doesn't.

This is an unfortunate name clash between packages.

Some choices are:
- unload ade4 package with detach(package:ade4).
- load vegan after ade4 so that its cca will cover ade4's.
- explicitly use vegan package with vegan::cca(varespec).

We (Jean Thioulouse of ade4 and I of vegan) are aware of this  
unfortunate name clash, and we discussed about avoiding the issue last  
May in Lyon(s). Vegan already contains some functions that alert you  
of mixing ade4::cca objects with vegan, and even tries to convert  
those to the vegan form.

Just a marginal note: namespaces wouldn't help in this name clash.

Cheers, Jari Oksanen


More information about the R-sig-ecology mailing list