ropensci-archive / nbaR

:warning: ARCHIVED :warning: R client library for the Netherlands Biodiversity Api (NBA)
Other
3 stars 2 forks source link

Explaining warnings #48

Closed hettling closed 5 years ago

hettling commented 5 years ago

https://github.com/naturalis/nbaR/blob/master/vignettes/sharks.Rmd#L190

This command raised two warnings:

times <- geo_age(unique(c(as.character(data$youngChronoName), as.character(data$oldChronoName)))) Warning messages: 1: In FUN(X[[i]], ...) : Could not retreive values for geo unit "Mioceen" from earthlifeconsortium.org 2: In FUN(X[[i]], ...) : Could not retreive values for geo unit "Unspecified age" from earthlifeconsortium.org It would be nice to have some text here for users to explain what these warnings are, and whether they matter.

hettling commented 5 years ago

I think the warning messages do explain very well what happens: earthlifeconsortium.org cannot provide time values for these geological periods. I added the information that NA's are returned:

> geo_age(c('aa', 'bb', 'Miocene'))
          aa bb Miocene
early_age NA NA   23.03
late_age  NA NA    5.33
Warning messages:
1: In FUN(X[[i]], ...) :
  Could not retrieve time values for geo unit "aa" from earthlifeconsortium.org, returning NA
2: In FUN(X[[i]], ...) :
  Could not retrieve time values for geo unit "bb" from earthlifeconsortium.org, returning NA
>

The In FUN(X[[i]]) we get because the function is vectorised.