Learn R Programming

HTSSIP (version 1.4.1)

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

Description

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

Usage

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

Run this code
# NOT RUN {
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)

# }

Run the code above in your browser using DataLab