Learn R Programming

rgbif (version 0.4.0)

dataset_suggest: Suggest datasets in GBIF.

Description

Search that returns up to 20 matching datasets. Results are ordered by relevance.

Usage

dataset_suggest(query = NULL, country = NULL,
    type = NULL, subtype = NULL, keyword = NULL,
    owning_org = NULL, hosting_org = NULL,
    publishing_country = NULL, decade = NULL,
    continent = NULL, limit = 20, start = NULL,
    callopts = list(), pretty = FALSE, description = FALSE)

Arguments

callopts
Pass on options to httr::GET for more refined control of http calls, and error handling
limit
Number of records to return
start
Record number to start at
query
Query term(s) for full text search. The value for this parameter can be a simple word or a phrase. Wildcards can be added to the simple word parameters only, e.g. q=*puma*
country
NOT YET IMPLEMENTED. Filters by country as given in isocodes$gbif_name, e.g. country=CANADA.
type
Type of dataset, options include OCCURRENCE, etc.
keyword
Keyword to search by. Datasets can be tagged by keywords, which you can search on. The search is done on the merged collection of tags, the dataset keywordCollections and temporalCoverages.
owning_org
Owning organization. A uuid string. See organizations
hosting_org
Hosting organization. A uuid string. See organizations
publishing_country
Publishing country. See options at isocodes$gbif_name
decade
Decade, e.g., 1980. Filters datasets by their temporal coverage broken down to decades. Decades are given as a full year, e.g. 1880, 1960, 2000, etc, and will return datasets wholly contained in the decade as well as those that cover the entire de
pretty
Print informative metadata using cat. Not easy to manipulate output though.
subtype
NOT YET IMPLEMENTED. Will allow filtering of datasets by their dataset subtypes, DC or EML.
continent
Not yet implemented, but will eventually allow filtering datasets by their continent(s) as given in our Continent enum.
description
Return descriptions only (TRUE) or all data (FALSE, default)

Value

  • A data.frame, list, or message printed to console (using pretty=TRUE).

References

http://www.gbif.org/developer/summary

Examples

Run this code
# Suggest datasets of type "OCCURRENCE".
dataset_suggest(query="Amazon", type="OCCURRENCE")

# Suggest datasets tagged with keyword "france".
dataset_suggest(keyword="france")

# Suggest datasets owned by the organization with key
# "07f617d0-c688-11d8-bf62-b8a03c50a862" (UK NBN).
dataset_suggest(owning_org="07f617d0-c688-11d8-bf62-b8a03c50a862")

# Fulltext search for all datasets having the word "amsterdam" somewhere in
# its metadata (title, description, etc).
dataset_suggest(query="amsterdam")

# Limited search
dataset_suggest(type="OCCURRENCE", limit=2)
dataset_suggest(type="OCCURRENCE", limit=2, start=10)

# Return just descriptions
dataset_suggest(type="OCCURRENCE", description=TRUE)

# Return metadata in a more human readable way (hard to manipulate though)
dataset_suggest(type="OCCURRENCE", pretty=TRUE)

# Search by country code. Lookup isocodes first, and use US for United States
isocodes[agrep("UNITED", isocodes$gbif_name),]
dataset_suggest(country="UNITED_STATES")

# Search by decade
dataset_suggest(decade=1980)

Run the code above in your browser using DataLab