davidclarance / rabm

The `rabm` package provides an interface to the Africa Bird Atlas data.
https://davidclarance.github.io/rabm/
3 stars 1 forks source link

function get_species_list fails for countries with no species #9

Open bluehill opened 5 years ago

bluehill commented 5 years ago

Example: get_species_list("egypt") Error in guessheader(datasource, tokenizer, locale) : Cannot read file C:/Users/Alan Lee/AppData/Local/Temp/RtmpQ71ZDZ/file6078395bae: The volume for a file has been externally altered so that the opened file is no longer valid.

Strongly suggest that at least in the beta version this call should be restricted to southafrica (and or surrounding southern african countries), nigeria, kenya: all other countries have very small numbers of contributions.

valid_countries <- c("kenya", "southafrica", "nigeria", "botswana", "namibia", "zimbabwe", "lesotho", "swaziland", "mozambique")

example addition if(country !%in% valid_countries) { stop(message = "Sorry; currently this call is only supported for Kenya, Southern Africa and Nigeria") }

davidclarance commented 5 years ago

Good point. Will add a catch error.