[R] cca in vegan (formula instead of community matrix data)

Bill.Venables at csiro.au Bill.Venables at csiro.au
Sat Jul 17 06:58:45 CEST 2010

As it says, (at least) one of your rows is all zeros.  CCA cannot handle such sites.

You might want to try something like this:

m.cca  <-
 cca(WinterM_ratio ~ topo_mean + coast + prec_max + 
 temp_min + evi_min,  data = datam, 
 subset = rowSums(WinterM_ratio) > 0) ### Note.

(Note that you do not need to put a "datam$" in front of the terms in
your formula.)

-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of elaine kuo
Sent: Saturday, 17 July 2010 2:45 PM
To: r-help at r-project.org
Subject: [R] cca in vegan (formula instead of community matrix data)

Dear List,

I tried to do cca based on species data and environmental variables (formula
instead of community data).
However, there was an error saying row sums must be >0.
I searched the previous related messages but found few solutions.
Please kindly help and thank you in advance.

This is vegan 1.17-3
Warning message:
package 'vegan' was built under R version 2.10.1


datam <-read.csv("c:/migration/M_R_20100707_winterM.csv",header=T,

m.cca  <-
+datam$temp_min+datam$evi_min,  datam)

error in  cca.default(d$X, d$Y, d$Z) :
  All row sums must be >0 in the community data matrix

	[[alternative HTML version deleted]]

R-help at r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list