get_taxmap_data

0th

Percentile

Get a data set from a taxmap object

NOTE: This will be replaced by the function `get_dataset` in the `taxa` package. Get a data set from a taxmap object and complain if it does not exist. This is intended to be used to parse options in other functions.

Keywords
internal
Usage
get_taxmap_data(obj, data)
Arguments
obj

A taxmap object

data

Which data set to use. Can be any of the following:

Name

The name of the data set to use.

Index

The index of the data set to use.

TRUE/FALSE vector

A TRUE/FALSE vector the same length as the number of datasets, with exactly one TRUE corresponding to the selected data set.

See Also

Other option parsers: get_taxmap_cols, get_taxmap_other_cols, get_taxmap_table, verify_taxmap

Aliases
  • get_taxmap_data
Examples
# NOT RUN {
# Parse data
x = parse_tax_data(hmp_otus, class_cols = "lineage", class_sep = ";",
                   class_key = c(tax_rank = "taxon_rank", tax_name = "taxon_name"),
                   class_regex = "^(.+)__(.+)$")
                   
# Get data set by name
print(metacoder:::get_taxmap_table(x, "tax_data"))
print(metacoder:::get_taxmap_table(x, "invalid"))

# Get data set by index
print(metacoder:::get_taxmap_table(x, 1))
print(metacoder:::get_taxmap_table(x, 3)) # invalid

# Get data set by T/F vector
print(metacoder:::get_taxmap_table(x, c(T, F)))
print(metacoder:::get_taxmap_table(x, c(T, T))) # invalid
print(metacoder:::get_taxmap_table(x, c(T, F, F))) # invalid
                   
# }
Documentation reproduced from package metacoder, version 0.3.3, License: GPL-2 | GPL-3

Community examples

Looks like there are no examples yet.