Skip to content

Commit

Permalink
decorana: require and check that data are numeric
Browse files Browse the repository at this point in the history
character data (or vector code) starting with " " is regarded < 0,
and give error of negative data. This can be behind the confusion
in https://stackoverflow.com/questions/78666646/
  • Loading branch information
jarioksa committed Jun 30, 2024
1 parent e42f93c commit 2ac16cb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions R/decorana.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
ZEROEIG <- 1e-7 # same limit as in the C function do_decorana
## data
veg <- as.matrix(veg)
if (!is.numeric(veg))
stop("data must be numeric (no factors nor characters)")
if (any(veg < 0))
stop("'decorana' cannot handle negative data entries")
## optional data transformation
Expand Down

0 comments on commit 2ac16cb

Please sign in to comment.