pick

0th

Percentile

Pick taxa

Pick out specific taxa, while others are dropped

Usage
pick(.data, ...)
Arguments
.data

Input, object of class Hierarchy, or hierarchies

...

quoted rank names (e.g., family) via ranks(), taxon names (e.g., Poa annua) via nms(), or taxonomic IDs (e.g., 93036) via ids(). You can't pass in arbitrary strings or numbers.

Details

supports Hierarchy and hierarchies objects

Value

an object of the same class as passed in

See Also

See filtering-helpers, including for more explanation of how this function works.

Aliases
  • pick
Examples
# NOT RUN {
# ranks
ex_hierarchy1
ex_hierarchy1 %>% pick(ranks("family"))
ex_hierarchy1 %>% pick(ranks("family", "genus"))
# taxon names
ex_hierarchy1 %>% pick(nms('Poa'))
ex_hierarchy1 %>% pick(nms("Poaceae", "Poa"))
# taxon ids
ex_hierarchy1 %>% pick(ids(4479))
ex_hierarchy1 %>% pick(ids(4479, 4544))
# mixed: ids and names
ex_hierarchy1 %>% pick(ranks("family"), ids(4544))

## single taxonomic group
ex_hierarchy1 %>% pick(ranks("family"))
pick(ex_hierarchy1, ranks("family"))
### more than 1 - remake res object above first
ex_hierarchy1 %>% pick(ranks("family", "genus"))


# hierarchies
# single taxonomic group
invisible(lapply(ex_hierarchies, print))
ex_hierarchies %>% pick(ranks("family")) %>% lapply(., print) %>% invisible

## more than one taxonomic group
invisible(lapply(ex_hierarchies, print))
ex_hierarchies %>% pick(ranks("family", "genus")) %>% lapply(., print) %>%
  invisible
# }
Documentation reproduced from package taxa, version 0.1.0, License: MIT + file LICENSE

Community examples

Looks like there are no examples yet.