# Simple example of retriving records in a genus:
idig_search(rq=list(genus="acer"), limit=10)
# This complex query shows that booleans passed to the API are represented
# as strings in R, fields used in the query don't have to be returned, and
# the syntax for accessing raw data fields:
idig_search(rq=list("hasImage"="true", genus="acer"),
fields=c("uuid", "data.dwc:preparations"), limit=100)
# "field"="values" actually searches the entire text of a field for the
# value, it is not an exact match. Searching inside a raw data field for a
# string:
idig_search(rq=list("data.dwc:dynamicProperties"="parasite"),
fields=c("uuid", "data.dwc:dynamicProperties"), limit=100)
# Retriving a data.frame for use with MaxEnt. Notice geopoint is expanded
# to two columns in the data.frame: gepoint.lat and geopoint.lon:
idig_search(rq=list(genus="acer"), fields=c("uuid", "geopoint"), limit=10)
write.csv(df[c("uuid", "geopoint.lon", "geopoint.lat")],
file="acer_occurrences.csv", row.names=FALSE)Run the code above in your browser using DataLab