Dear Shailendra Pal,

Welcome to the R-help mailing list! Most of us are not members of
RStudio in any way. Your problem is also purely about programming in R,
so you've come to the right place. You have also done the right thing
by showing us the code.

On Fri, 8 Dec 2023 16:08:51 +0530
shailendra pal <palshailend...@gmail.com> wrote:

> vare.cca <- cca(sptrans, envtrans)

> Error in cca.default(sptrans, envtrans) :
>   all row sums must be >0 in the community data matrix

One of the most important tools provided by R is its online help
system. Use it to look up the documentation for the function you're
having problems with. You can prepend a question mark to most function
calls and get a help page in response; failing that, help('cca') should
also work. Here's what it says:

>> ## Default S3 method:
>> cca(X, Y, Z, ...)

>> X Community data matrix.
>> Y Constraining matrix, typically of environmental variables

In other words, the "community data matrix" mentioned in the error
message is your `sptrans` data.frame. The function complains that at
least some of the rows don't have a positive sum, which is a
requirement of the method. Can you spot the problem by looking at the
data or using rowSums()? 

-- 
Best regards,
Ivan

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Reply via email to