Open AMBarbosa opened 1 year ago
Hello, thanks for your comment.
In fact the condition if (EOO < AOO) EOO <- AOO
is applied only if EOO can be calculated. But if you have one or two occurrences EOO cannot be calculated.
The test for a straight line is only done when there is more than 3 pairs of unique coordinates.
Whether EOO should be set equal to AOO if it cannot be calculated is a good question. I should check what the guidelines says.
I figure if the condition applies to 3 presences in a straight line, it should also apply to 2 presences (which are necessarily in a straight line), and ultimately to one presence as well. The extent (area) of a line or a point should be zero; it should only be NA if there were no presence points at all. If there is an AOO, to me it only makes sense to have an EOO too.
You are right, I'll modify this asap
Dear @AMBarbosa
since I am currently working on a new version of the package, I updated the developmental version which is quite different from the original one. I cannot maintain both packages in parallel. The ConR currently on CRAN will probably be achived at some point and replaced by the new version.
I therefore updated the new version accordingnly and I suggest you try this one
devtools::install_github("gdauby/ConR@devel")
library(ConR)
(example <- structure(list(lon = c(-2.59487105548141, -2.01867048441999), lat = c(39.1635112135211, 38.9798640743379), species = c("myspecies", "myspecies")), row.names = c(1L, 2L), class = "data.frame"))
criterion_B(x = example )
The ConR::IUCN.eval
not longer exist and has been replaced by criterion_B
.
Let me know if you have any issue or questions.
Concerning this issue, note that EOO is not set equal to AOO if EOO < AOO or if EOO cannot be computed which is the case when there are less than 3 unique pairs of coordinates. If pairs of coordinates form a straitgh line (tested when at least 3 unique pairs of coordinates), 'noise' is added to coordinates to avoid the straight line (no buffer anymore).
In my use case, it is not too uncommon for some species to have only one or two presence points in the study area. In these cases, the EOO "polygon" is actually a point or a line, so it has an area of zero. IUCN guidelines say that, in such cases, EOO should be set as =AOO. Actually I see this in the code for
getAnywhere(.IUCN.comp)
:if (EOO < AOO) EOO <- AOO
. However, this seems to get lost somewhere, as the result ofIUCN.eval()
still says EOO is NA for these species. Maybe it should be changed toif (is.na(EOO) || EOO < AOO) EOO <- AOO
?I've also tried specifying
buff_width
to get an actual polygon around the occurrences, but it seems to be ignored, as well as thedraw.poly.EOO
argument.Here's a reproducible example:
A fix would be greatly appreciated! Cheers