Skip to content
Prev 1363 / 7420 Next

Negative Data Error with Decorana in Vegan

On Mon, 2010-07-19 at 17:35 -0700, Michele Tobias wrote:
No; decorana has a check for that:

require(vegan)
data(dune)
dune[1,1] <- "10"
decorana(dune)
Error in rowSums(veg) : 'x' must be numeric
Yes; some of your data takes values less than 0 :-)
You might think the data are all positive, but I'm certain R doesn't
think so *after* it has been processed to a matrix within decorana.

Unless you provide evidence to the contrary (such as a reproducible
example, your data, or summary output from your data) then sort your
data out so that it doesn't contain negative values.

To help further, post the output of the following:

str(dataord)
sapply(dataord, range)
apply(as.matrix(dataord), 2, range)
which(dataord < 0)

As that is likely to point to the problem. Hopefully at that point
you'll see where the problem with your data is and can sort it out
yourself. If not, post the output from the above to the list and I'll
take a closer look for you.

Also, please post details of your session info:

sessionInfo()

The above examples were with:
R version 2.11.1 Patched (2010-07-18 r52561) 
i686-pc-linux-gnu 

locale:
 [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_GB.UTF-8        LC_COLLATE=en_GB.UTF-8    
 [5] LC_MONETARY=C              LC_MESSAGES=en_GB.UTF-8   
 [7] LC_PAPER=en_GB.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods  
[7] base     

other attached packages:
[1] vegan_1.17-2

loaded via a namespace (and not attached):
[1] tools_2.11.1

Note my vegan installation on my laptop is not quite up-to-date (1.17-3
is current) but there were no changes to decorana between my version and
the one on CRAN.
HTH

G