[R] regarding CCA plot

Ivan Krylov kry|ov@r00t @end|ng |rom gm@||@com
Sat Dec 9 15:38:38 CET 2023


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 <palshailendra9 using 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



More information about the R-help mailing list