supertaxa_apply

0th

Percentile

Apply function to supertaxa of each taxon

Apply a function to the supertaxa for each taxon. This is similar to using supertaxa() with lapply() or sapply().

obj$supertaxa_apply(func, subset = NULL, recursive = TRUE,
  simplify = FALSE, include_input = FALSE, value = NULL,
  na = FALSE, ...)
supertaxa_apply(obj, func, subset = NULL, recursive = TRUE,
  simplify = FALSE, include_input = FALSE, value = NULL,
  na = FALSE, ....)

Arguments
obj

The taxonomy() or taxmap() object containing taxon information to be queried.

func

(function) The function to apply.

subset

(character) taxon_ids or indexes of taxon_data for which supertaxa will be returned. Default: All taxa in obj will be used.

recursive

(logical or numeric) If FALSE, only return the supertaxa one rank above the target taxa. If TRUE, return all the supertaxa of every supertaxa, etc. Positive numbers indicate the number of recursions (i.e. number of ranks above the target taxon to return). 1 is equivalent to FALSE. Negative numbers are equivalent to TRUE.

simplify

(logical) If TRUE, then combine all the results into a single vector of unique values.

include_input

(logical) If TRUE, the input taxa are included in the output

value

What data to give to the function. Any result of all_names(obj) can be used, but it usually only makes sense to use data that has an associated taxon id.

na

(logical) If TRUE, return NA where information is not available.

...

Extra arguments are passed to the function.

Aliases
  • supertaxa_apply
Examples
# NOT RUN {
# Get classifications for each taxon
supertaxa_apply(ex_taxmap, paste, collapse = ";", include_input = TRUE,
                value = "taxon_names")
# }
Documentation reproduced from package taxa, version 0.1.0, License: MIT + file LICENSE

Community examples

Looks like there are no examples yet.