get_tsn(searchterm, searchtype = "scientific", accepted = FALSE, ask = TRUE, verbose = TRUE, rows = NA, ...)
as.tsn(x, check = TRUE)
"as.tsn"(x, check = TRUE)
"as.tsn"(x, check = TRUE)
"as.tsn"(x, check = TRUE)
"as.tsn"(x, check = TRUE)
"as.tsn"(x, check = TRUE)
"as.data.frame"(x, ...)
get_tsn_(searchterm, verbose = TRUE, searchtype = "scientific", accepted = TRUE, rows = NA)
FALSE
(default) to give back both accepted and unaccepted names.TRUE
and more than one TSN is found for the species, the user is asked for
input. If FALSE
NA is returned for multiple matches.get_tsn_
to get back all, or a subset, of the raw data that you are
presented during the ask process.as.tsn
NA
is given. If more than one identifier is found the
function asks for user input if ask = TRUE
, otherwise returns NA
.
If ask=FALSE
and rows
does not equal NA
, then a data.frame is
given back, but not of the uid class, which you can't pass on to other functions
as you normally can.Comes with the following attributes:
ask = FALSE
then 'NA due to ask=FALSE')
TRUE
, even if you get 1 name back because we try
to pattern match the name to see if there's any direct matches. So sometimes
this attribute is TRUE
, as well as pattern_match
, which then returns 1
resulting name without user prompt.
TRUE
then multiple_matches
must be TRUE
, and we found a perfect match to your
name, ignoring case. If FALSE
get_uid
, get_tsn
,
get_gbifid
, get_tpsid
,
get_eolid
, get_colid
,
get_ids
, classification
## Not run:
# get_tsn(searchterm = "Quercus douglasii")
# get_tsn(searchterm = "Chironomus riparius")
# get_tsn(c("Chironomus riparius","Quercus douglasii"))
# splist <- c("annona cherimola", 'annona muricata', "quercus robur",
# "shorea robusta", "pandanus patina", "oryza sativa", "durio zibethinus")
# get_tsn(splist, verbose=FALSE)
#
# # specify rows to limit choices available
# get_tsn('Arni')
# get_tsn('Arni', rows=1)
# get_tsn('Arni', rows=1:2)
#
# # When not found
# get_tsn("howdy")
# get_tsn(c("Chironomus riparius", "howdy"))
#
# # Using common names
# get_tsn(searchterm="black bear", searchtype="c")
#
# # Convert a tsn without class information to a tsn class
# as.tsn(get_tsn("Quercus douglasii")) # already a tsn, returns the same
# as.tsn(get_tsn(c("Chironomus riparius","Pinus contorta"))) # same
# as.tsn(19322) # numeric
# as.tsn(c(19322,129313,506198)) # numeric vector, length > 1
# as.tsn("19322") # character
# as.tsn(c("19322","129313","506198")) # character vector, length > 1
# as.tsn(list("19322","129313","506198")) # list, either numeric or character
# ## dont check, much faster
# as.tsn("19322", check=FALSE)
# as.tsn(19322, check=FALSE)
# as.tsn(c("19322","129313","506198"), check=FALSE)
# as.tsn(list("19322","129313","506198"), check=FALSE)
#
# (out <- as.tsn(c(19322,129313,506198)))
# data.frame(out)
# as.tsn( data.frame(out) )
#
# # Get all data back
# get_tsn_("Arni")
# get_tsn_("Arni", rows=1)
# get_tsn_("Arni", rows=1:2)
# get_tsn_(c("asdfadfasd","Pinus contorta"), rows=1:5)
#
# # use curl options
# library("httr")
# get_tsn("Quercus douglasii", config=verbose())
# bb <- get_tsn("Quercus douglasii", config=progress())
# ## End(Not run)
Run the code above in your browser using DataLab