Last taxon state object from a get_* function call
Value
taxon_last() returns an object of class taxon_state, the last
one used, else NULL if none found. taxon_clear() clears the saved state
Details
taxon_last(): get the lasttaxon_stateobject in usetaxon_clear(): clear any data from lasttaxon_stateobject
The taxon_state object is an R6 object that holds data and methods
used for keeping track of results gathered within a get_* function.
You shouldn't create taxon_state R6 objects yourself.
Behaviors to be aware of:
If a
taxon_stateobject is not passed you don't need to worry about a previously runget_*function interfering with anotherget_*function call - you have to explicitly pass ataxon_stateobject to usetaxon_stateThe passed in
taxon_stateobject must have a$classmatching that of theget_*function being called. For example, you can only pass ataxon_statewith$classofgbifidtoget_gbifid(), and so on.If you run
taxon_clear()while aget*function is running, you may lose track of any state known to this package before it was cleared
See the internal method progressor for information on how we control messages
in get* functions
Examples
if (FALSE) { # \dontrun{
spp <- names_list("species", 3)
res <- get_gbifid(spp)
z <- taxon_last()
z
z$taxa_remaining()
z$taxa_completed()
z$count # active binding; no parens needed
# cleanup
taxon_clear()
} # }
