speciesgeocodeR
speciesgeocodeR copied to clipboard
Error in automated conservation assessment
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 byCalcRange()
. -
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).