ropensci / rgbif Goto Github PK
View Code? Open in Web Editor NEWInterface to the Global Biodiversity Information Facility API
Home Page: https://docs.ropensci.org/rgbif
License: Other
Interface to the Global Biodiversity Information Facility API
Home Page: https://docs.ropensci.org/rgbif
License: Other
Need to maintain aspect ratio while plotting maps with fxns gbifmap_list
, gbifmap_dens
and gbifmap
. The maps might look like this
depending on the setting.
We can simply do it by adding coord_fixed(ratio = 1)
in functions i.e.
...
geom_polygon(aes(group=group), fill="white", color="gray40", size=0.2) + coord_fixed(ratio = 1) +
..
Can't I get more than 1000 results?
> pres_rgbif <- occurrencelist(scientificname='Erebia gorge*', maxresults = 2000,
+ coordinatestatus = TRUE, latlongdf = TRUE, removeZeros = FALSE)
> nrow(pres_rgbif)
[1] 1000
> require(dismo)
> pres_dismo <- gbif("Erebia", "gorge*",sp=TRUE)
Erebia gorge* : 1739 occurrences found
0-1000-1739
> nrow(pres_dismo)
[1] 1739
Not sure what's going on here. Why a function inside a function? The inner function could just be removed to avoid inefficient programming.
To add all parameters possible for 'occurrencelist' function to make it complete
From a user via email, should change to stringsAsFactors=FALSE
to avoid this problem
See supported facet filters, and maybe more too
Hi thanks for this package it's really very useful! I just tried out the GitHub version over the one found in CRAN, and ran into an issue just with the demo usage. This in no way affects me, just thought you might want a heads up.
splist <- c('Accipiter erythronemius', 'Junco hyemalis', 'Aix sponsa', 'Buteo regalis')
out <- lapply(splist, function(x) occurrencelist(x, coordinatestatus = T, maxresults = 100))
Warning messages:
1: In FUN(1:7[[7L]], ...) : NAs introduced by coercion
2: In FUN(1:7[[7L]], ...) : NAs introduced by coercion
3: In FUN(1:7[[7L]], ...) : NAs introduced by coercion
4: In FUN(1:7[[7L]], ...) : NAs introduced by coercion
5: In FUN(1:7[[7L]], ...) : NAs introduced by coercion
6: In FUN(1:7[[7L]], ...) : NAs introduced by coercion
7: In FUN(1:7[[7L]], ...) : NAs introduced by coercion
8: In FUN(1:7[[7L]], ...) : NAs introduced by coercion
gbifmap(out)
Error in UseMethod("gbifmap") :
no applicable method for 'gbifmap' applied to an object of class "list"
I was reading the rgbif tutorial to integrate part of it into a figshare tutorial and I get the following error when I run this code snippet
library(rgbif)
dan_chr <- occurrencelist(sciname = "Danaus chrysippus", coordinatestatus = TRUE, maxresults = 1000, latlongdf = TRUE)
Namespace prefix to on decimalLatitude is not defined (but repeated 1000x)
From Karthik:
"additional suggestions. rather than have "poitntype" why not keep it as geom? Would make it easier for regular ggplotters to guess the correct one rather than learn new usage. Same with jitterposition. why not just "jitter"?"
Related to #25 -
Need to change gbifdata
return data without removing rows with lat/long data that have missing values/zero values/etc.
Port over maps like used in rbison
to rgbif
The GBIF API allows you to set multiple values for some parameters. See here
e.g., you can do scientificname='Abies'&scientificname='Pinus'
Also, can do with other parameters:
scientificname, taxonconceptkey, dataproviderkey, dataresourcekey, resourcenetworkkey, basisofrecordcode, cellid, centicellid, hostisocountrycode, originisocountrycode, originregioncode, year, month, day
One solution is to do
scientificname = c('Puma concolor','Accipiter erythronemius')
makemanylist <- function(x)
{
if(length(x) > 1){
temp <- as.list(x)
names(temp) <- rep(deparse(substitute(x)), length(x))
temp
} else
{
x
}
}
makemanylist(scientificname)
$scientificname
[1] "Puma concolor"
$scientificname
[1] "Accipiter erythronemius"
Fix this...
From user Joseph:
occurrencelist
and occurrencelist_many
throwing errors
1: In FUN(1:7[[7L]], ...) : NAs introduced by coercion
2: In FUN(1:7[[7L]], ...) : NAs introduced by coercion
3: In FUN(1:7[[7L]], ...) : NAs introduced by coercion
mentioned in this bug report
* checking S3 generic/method consistency ... WARNING
gbifdata:
function(input, minimal)
gbifdata.gbifdens:
function(input)
gbifmap:
function(input, ...)
gbifmap.gbifdens:
function(input, mapdatabase, region, customize)
gbifmap:
function(input, ...)
gbifmap.gbiflist:
function(input, mapdatabase, region, geom, jitter, customize)
print:
function(x, ...)
print.gbifdens:
function(x)
print:
function(x, ...)
print.gbiflist:
function(x)
-Need to change old parameter additions to queries in some of the functions to use the getForm style of querying.
-Species names probably needs to still have the paste() thing to put a +, etc. in between genus and epithet
-add all parameters possible for some functions instead of just a few
-figure out if stylesheet is actually a parameter to include
-include some shortcuts to plotting results on a map using ggplot2
Following on Gavin's suggestions:
Step 1: add deprecated stuff and submit to CRAN
.Deprecated()
within the body of deprecated functions, and specify what the new function name is to use, if any.fxnname-deprecated.Rd
rgbif-deprecated.Rd
file to list deprecated functionsStep 2: add defunct stuff and submit to CRAN
At some later point, whenever ready:
.Defunct()
fxnname-deprecated.Rd
entriesrgbif-deprecated.Rd
rgbif-defunct.Rd
Relate to issues #25
Change search functions in rgbif including occurrencelist
, occurrencelist_many
,and densitylist
so that they match the search functionality of the GBIF website.
E.g., in issue #25 the search for 'Aristolochia serpentaria' only returns exact matches of 'Aristolochia serpentaria', whereas the site returns fuzzy matches.
try to change rgbif to match behavior of GBIF website
This may be hard though
if as simple as always changing 'Aristolochia serpentaria' to 'Aristolochia serpentaria*', would be easy, but perhaps not that easy
In version 0.3.0, I noticed that the occurrencelist() function does return all of the records that an identical query at http://data.gbif.org/ .
For example the query:
occurrencelist(scientificname = 'Aristolochia serpentaria', coordinatestatus = TRUE, maxresults = 1e6)
returns 179 records but the identical query at http://data.gbif.org/ returns 431 records.
I have not tried to track down the potential source of this discrepancy in the code yet. I also have not investigated if other versions of rgbif have similar issues.
Right now returns lists
Is the following bad/meaningless (if not meaningful, remove)?
In is.na(df$decimalLatitude) :
is.na() applied to non-(list or vector) of type 'NULL'
Right now name_lookup
returns a list of a whole bunch of data. Make an option for more concise output.
From @ibartomeus on twitter
with respect to occurrencelist fxn
stop_for_status
, etc.
Hey fellas,
I'm not sure if this is the best place for this so if not I'm happy to repost elsewhere but I just wanted to let you know that the cran version of rgbif is returning wonky species results for the function occurrencelist(). For example if you attempt to run the examples in ~/library/rgbif/demo/List.R then you will see that the queries return results for a variety of different species names. Each time you run a query you get a different set of species names as well. My version of R is 2.15.1 (64-bit).
This does not happen in the github version of the package! Let me know if you need more specifics.
Dan
Figure out how to allow users to style geojson point, polygon, line, etc. feature types.
stylegeojson()
.Minor point but had me confused.
occ_search takes taxonKey NOT name but then in arguments you have:
taxonKey - Scientific name
Change https://github.com/ropensci/rgbif/blob/newapi/R/zzz.r from capwords()
to gbif_capwords()
maybe
All the examples and tutorials we have on the site and many of our talks don't work anymore. gbifmap
was replaced by gbifmap_dens
and gbifmap_list
and this doesn't seem to map out correctly.
for e.g.
> a <- occurrencelist(scientificname = "Puma concolor", coordinatestatus = TRUE, maxresults = 40)
> gbifmap(a)
Error: could not find function "gbifmap"
Minor point but had me confused.
occ_search takes taxonKey NOT name but then in arguments you have:
taxonKey - Scientific name
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.