get_nbnid(name, ask = TRUE, verbose = TRUE, rec_only = FALSE, rank = NULL, rows = NA, ...)
as.nbnid(x, check = TRUE)
"as.nbnid"(x, check = TRUE)
"as.nbnid"(x, check = TRUE)
"as.nbnid"(x, check = TRUE)
"as.nbnid"(x, check = TRUE)
"as.data.frame"(x, ...)
get_nbnid_(name, verbose = TRUE, rec_only = FALSE, rank = NULL, rows = NA, ...)
TRUE
ids of recommended names are returned (i.e.
synonyms are removed). Defaults to FALSE
. Remember, the id of a synonym is a
taxa with 'recommended' name status.get_nbnid_
to get back all, or a subset, of the raw data that you are
presented during the ask process.nbn_search
as.nbnid
as.nbnid
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_tsn
, get_uid
,
get_tpsid
, get_eolid
,
get_colid
, get_ids
,
classification
## Not run:
# get_nbnid(name='Poa annua')
# get_nbnid(name='Poa annua', rec_only=TRUE)
# get_nbnid(name='Poa annua', rank='Species')
# get_nbnid(name='Poa annua', rec_only=TRUE, rank='Species')
# get_nbnid(name='Pinus contorta')
#
# # The NBN service handles common names too
# get_nbnid(name='red-winged blackbird')
#
# # specify rows to limit choices available
# get_nbnid('Poa annua')
# get_nbnid('Poa annua', rows=1)
# get_nbnid('Poa annua', rows=25)
# get_nbnid('Poa annua', rows=1:2)
#
# # When not found
# get_nbnid(name="uaudnadndj")
# get_nbnid(c("Zootoca vivipara", "uaudnadndj"))
# get_nbnid(c("Zootoca vivipara","Chironomus riparius", "uaudnadndj"))
#
# # Convert an nbnid without class information to a nbnid class
# as.nbnid(get_nbnid("Zootoca vivipara")) # already a nbnid, returns the same
# as.nbnid(get_nbnid(c("Zootoca vivipara","Pinus contorta"))) # same
# as.nbnid('NHMSYS0001706186') # character
# as.nbnid(c("NHMSYS0001706186","NHMSYS0000494848","NBNSYS0000010867")) # character vector, length > 1
# as.nbnid(list("NHMSYS0001706186","NHMSYS0000494848","NBNSYS0000010867")) # list
# ## dont check, much faster
# as.nbnid('NHMSYS0001706186', check=FALSE)
# as.nbnid(list("NHMSYS0001706186","NHMSYS0000494848","NBNSYS0000010867"), check=FALSE)
#
# (out <- as.nbnid(c("NHMSYS0001706186","NHMSYS0000494848","NBNSYS0000010867")))
# data.frame(out)
# as.nbnid( data.frame(out) )
#
# # Get all data back
# get_nbnid_("Zootoca vivipara")
# get_nbnid_("Poa annua", rows=2)
# get_nbnid_("Poa annua", rows=1:2)
# get_nbnid_(c("asdfadfasd","Pinus contorta"), rows=1:5)
#
# # use curl options
# library("httr")
# get_nbnid("Quercus douglasii", config=verbose())
# bb <- get_nbnid("Quercus douglasii", config=progress())
# ## End(Not run)
Run the code above in your browser using DataLab