View source: R/dada_phyloseq.R
subset_samples_pq | R Documentation |
The main objective of this function is to complete the
phyloseq::subset_samples()
function by propose a more easy
(but more prone to error) way of subset_samples.
It replace the subsetting expression which used the name of the variable
in the sam_data by a boolean vector.
Warnings: you must verify the result of this function as the
boolean condition must match the order of samples in the sam_data
slot.
This function is robust when you use the sam_data slot of the phyloseq object used in physeq (see examples)
subset_samples_pq(physeq, condition)
physeq |
(required): a |
condition |
A boolean vector to subset samples. Length must fit the number of samples |
a new phyloseq object
cond_samp <- grepl("A1", data_fungi@sam_data[["Sample_names"]])
subset_samples_pq(data_fungi, cond_samp)
subset_samples_pq(data_fungi, data_fungi@sam_data[["Height"]] == "Low")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.