[R] cca in ade4

Gavin Simpson gavin.simpson at ucl.ac.uk
Sat Jul 17 19:47:10 CEST 2010


On Sat, 2010-07-17 at 13:31 +0800, elaine kuo wrote:
> Dear List,
> 
> I used spec and envi for cca in ade4. (both are data.frame)
> 
> However, there is a message telling that
> error in if (nf > rank) nf <- rank R
> missing value in  TRUE/FALSE
> 
> Please kindly help how to modify the code below.
> Thank you.

We can't possibly diagnose the problem as we don't have spec or envi.

If this is anything like the same data used in the vegan:::cca question
posted earlier, then you have samples with no species data recorded.
Drop those and fit the model again and see if you get any further.

HTH

G

> 
> Elaine
> 
> 
> code
> rm(list=ls())
> spec <-read.csv("c:/migration/M_R_20100718_winterM_spec_vegan.csv",header=T,
> row.names=1)
> dim(spec)
> spec[1,]
> 
> envi <-read.csv("c:/migration/M_R_20100718_winterM_envi_vegan.csv",header=T,
> row.names=1)
> dim(envi)
> envi[1,]
> 
> library(ade4)
> 
> w.cca  <-  cca(spec, envi, scan=TRUE)
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

-- 
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
 Dr. Gavin Simpson             [t] +44 (0)20 7679 0522
 ECRC, UCL Geography,          [f] +44 (0)20 7679 0565
 Pearson Building,             [e] gavin.simpsonATNOSPAMucl.ac.uk
 Gower Street, London          [w] http://www.ucl.ac.uk/~ucfagls/
 UK. WC1E 6BT.                 [w] http://www.freshwaters.org.uk
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%



More information about the R-help mailing list