Learn R Programming

taxize (version 0.5.2)

get_gbifid: Get the GBIF backbone taxon ID from taxonomic names.

Description

Get the GBIF backbone taxon ID from taxonomic names.

Usage

get_gbifid(sciname, ask = TRUE, verbose = TRUE, rows = NA)

as.gbifid(x, check = FALSE)

## S3 method for class 'gbifid': as.gbifid(x, check = FALSE)

## S3 method for class 'character': as.gbifid(x, check = TRUE)

## S3 method for class 'list': as.gbifid(x, check = TRUE)

## S3 method for class 'numeric': as.gbifid(x, check = TRUE)

## S3 method for class 'data.frame': as.gbifid(x, check = TRUE)

## S3 method for class 'gbifid': as.data.frame(x, ...)

get_gbifid_(sciname, verbose = TRUE, rows = NA)

Arguments

sciname
character; scientific name.
ask
logical; should get_colid be run in interactive mode? If TRUE and more than one ID is found for the species, the user is asked for input. If FALSE NA is returned for multiple matches.
verbose
logical; If TRUE the actual taxon queried is printed on the console.
rows
numeric; Any number from 1 to inifity. If the default NA, all rows are considered. Note that this function still only gives back a gbifid class object with one to many identifiers. See get_gbifid_
x
Input to as.gbifid
check
logical; Check if ID matches any existing on the DB, only used in as.gbifid
...
Ignored

Value

  • A vector of unique identifiers. If a taxon is not found NA. If more than one ID is found the function asks for user input.

Details

Internally in this function we use a function to search GBIF's taxonomy, and if we find an exact match we return the ID for that match. If there isn't an exact match we return the options to you to pick from.

See Also

get_tsn, get_uid, get_tpsid, get_eolid, get_colid

Examples

Run this code
get_gbifid(sciname='Poa annua')
get_gbifid(sciname='Pinus contorta')
get_gbifid(sciname='Puma concolor')

# multiple names
get_gbifid(c("Poa annua", "Pinus contorta"))

# specify rows to limit choices available
get_gbifid(sciname='Pinus')
get_gbifid(sciname='Pinus', rows=10)
get_gbifid(sciname='Pinus', rows=1:3)

# When not found, NA given
get_gbifid(sciname="uaudnadndj")
get_gbifid(c("Chironomus riparius", "uaudnadndj"))

# Convert a uid without class information to a uid class
as.gbifid(get_gbifid("Poa annua")) # already a uid, returns the same
as.gbifid(get_gbifid(c("Poa annua","Puma concolor"))) # same
as.gbifid(2704179) # numeric
as.gbifid(c(2704179,2435099,3171445)) # numeric vector, length > 1
as.gbifid("2704179") # character
as.gbifid(c("2704179","2435099","3171445")) # character vector, length > 1
as.gbifid(list("2704179","2435099","3171445")) # list, either numeric or character
## dont check, much faster
as.gbifid("2704179", check=FALSE)
as.gbifid(2704179, check=FALSE)
as.gbifid(2704179, check=FALSE)
as.gbifid(c("2704179","2435099","3171445"), check=FALSE)
as.gbifid(list("2704179","2435099","3171445"), check=FALSE)

(out <- as.gbifid(c(2704179,2435099,3171445)))
data.frame(out)
as.uid( data.frame(out) )

# Get all data back
get_gbifid_("Puma concolor")
get_gbifid_(c("Pinus", "uaudnadndj"))
get_gbifid_(c("Pinus", "Puma"), rows=5)
get_gbifid_(c("Pinus", "Puma"), rows=1:5)

Run the code above in your browser using DataLab