get_taxmap_cols

0th

Percentile

Get a column subset

Convert logical, names, or indexes to column names and check that they exist.

Keywords
internal
Usage
get_taxmap_cols(obj, data, cols = NULL)
Arguments
obj

A taxmap object

data

The name of a table in obj that contains counts.

cols

The columns in the data set to use. Takes one of the following inputs:

TRUE/FALSE:

All non-target columns will be preserved or not.

Vector of TRUE/FALSE of length equal to the number of columns:

Preserve the columns corresponding to TRUE values.

Character vector:

The names of columns to preserve

Numeric vector:

The indexes of columns to preserve

See Also

Other option parsers: get_taxmap_data, get_taxmap_other_cols, get_taxmap_table, verify_taxmap

Aliases
  • get_taxmap_cols
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 all col names
metacoder:::parse_taxmap_cols(x, "tax_data")

# Get col names by index
metacoder:::parse_taxmap_cols(x, "tax_data", 2:4)

# Get col names by name (i.e. verify)
metacoder:::parse_taxmap_cols(x, "tax_data", c("taxon_id", "lineage"))
metacoder:::parse_taxmap_cols(x, "tax_data", c("taxon_id", "not_valid"))

# Get colnames by TRUE/FALSE vector
metacoder:::parse_taxmap_cols(x, "tax_data", startsWith(colnames(x$data$tax_data), "7"))
                   
# }
Documentation reproduced from package metacoder, version 0.3.3, License: GPL-2 | GPL-3

Community examples

Looks like there are no examples yet.