expr_param_extract: Extract all quoted values in the expression used for phyloseq...

Description Usage Arguments Value Examples

View source: R/phyloseq_subset.R

Description

This can be useful for creating custom (shorter) labels for each subset relative to using the entire subsetting expression.

Usage

1
expr_param_extract(ex, collapse = NULL)

Arguments

ex

Expression for subsetting the phyloseq object

collapse

Similar to the collapse parameter in base::paste

Value

If length(ex) == 1, then a vector of quoted values in the input string. If length(ex) > 1, then a matrix or list of quote values, 1 column/index per input string.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
ex = '(Substrate=="12C-Con" & Day=="14")'
expr_param_extract(ex)

ex = '(Substrate=="12C-Con" & Day=="14") | (Substrate=="13C-Cel" & Day == "14")'
expr_param_extract(ex)

# returns a matrix
ex = c('(Substrate=="12C-Con" & Day=="14")',
       '(Substrate=="13C-Cel" & Day == "14")')
expr_param_extract(ex)

# returns a list
ex = c('(Substrate=="12C-Con" & Day=="14")',
       '(Substrate=="13C-Cel" & Day == "14")',
       '(Substrate=="13C-Cel")')
expr_param_extract(ex)

nick-youngblut/HTSSIP documentation built on May 23, 2019, 4:46 p.m.