speciesgeocodeR icon indicating copy to clipboard operation
speciesgeocodeR copied to clipboard

Error in automated conservation assessment

Open estopinj opened this issue 4 years ago • 0 comments

I found an error in the example code chunk to perform automatic IUCN assessment:

library(sp, speciesgeocodeR)

occ.exmpl<- data.frame(species = sample(letters, size = 250, replace = TRUE),
                       decimallongitude = runif(n = 250, min = 42, max = 51),
                       decimallatitude = runif(n = 250, min = -26, max = -11))

rang <- CalcRange(occ.exmpl, method = 'pseudospherical', terrestrial = FALSE)
IUCNest(rang)

Here is how I explain it:

  • As specified by doc, IUCNest() expects as 1st argument an object of the class range.sizes, as produced by CalcRange().

  • But: CalcRange() function does not provide a range.sizes object but an object of the class SpatialPolygonsDataFrame (S4).

  • Accesses done in IUCNest() source code can not work, hence the DD status for all species (variables $EOO or $AOO do not exist in S4 objects).

estopinj avatar Dec 17 '20 15:12 estopinj