[R-sig-Geo] Problems with gbif function in package dismo

Tim Bean timbean at gmail.com
Thu Jun 16 19:45:11 CEST 2016


Thanks for the quick response. Update: GBFI has fixed the API bug and the
function is now working as expected.

On Wed, Jun 15, 2016 at 2:40 PM, Manuel Spínola <mspinola10 at gmail.com>
wrote:

> Dear Tim,
>
> It could be an error in your code, you wrote:
>
> sp.occur <- gbif(genus='Erethizon', species='', geo=TRUE)
>
> appear that you have a missing quote after species=
>
> Manuel
>
> 2016-06-15 14:41 GMT-06:00 Tim Bean <timbean at gmail.com>:
>
>> Hello r-sig-geo,
>> The gbif function in package dismo does not appear to be functioning. No
>> matter what genus/species combination I try, the function finds 0 records.
>> For example:
>>
>> sp.occur <- gbif(genus='Erethizon', species='', geo=TRUE)
>>
>> Returns "0 records found."
>>
>> I've tried to go through the underlying code to generate the gbif API
>> call,
>> for example:
>>
>>
>> http://api.gbif.org/v1/occurrence/search?scientificname=Erethizon+dorsatum&limit=1
>>
>> which returns:
>>
>>
>> {"offset":0,"limit":1,"endOfRecords":true,"count":0,"results":[],"facets":[]}
>>
>> The GBIF API documentation suggests that perhaps that should be:
>>
>>
>> http://api.gbif.org/v1/occurrence/search?scientificName=Erethizon+dorsatum&limit=1
>>
>> (note "scientificName" with capital 'N'), but I get no results with that
>> either.
>>
>> However, identifying the genusKey:
>>
>> http://api.gbif.org/v1/species/match?genus=Erethizon
>>
>> which returns genusKey=2437593
>>
>> and using that to search occurrence records:
>>
>> http://api.gbif.org/v1/occurrence/search?genusKey=2437593
>>
>> produces the expected results. Is anybody else having problems with the
>> dismo function? Does anybody know if GBIF has updated their API? Am I
>> missing something obvious?
>>
>> Thanks,
>> Tim
>>
>>         [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>
>
>
> --
> *Manuel Spínola, Ph.D.*
> Instituto Internacional en Conservación y Manejo de Vida Silvestre
> Universidad Nacional
> Apartado 1350-3000
> Heredia
> COSTA RICA
> mspinola at una.cr <mspinola at una.ac.cr>
> mspinola10 at gmail.com
> Teléfono: (506) 8706 - 4662
> Personal website: Lobito de río
> <https://sites.google.com/site/lobitoderio/>
> Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>
>

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list