View source: R/phyloseq_subset.R
| subdivide_by_environment | R Documentation |
This function tries to mimic tidyr::nest, subsetting the phyloseq object based
on all combinations of sample data.
subdivide_by_environment( physeq, variables, keep_variables = TRUE, keep_empty = TRUE, extract_list = FALSE, ... )
physeq |
A phyloseq object |
variables |
A character vector containing the names of the variables to nest by, these variables should be discrete (factor, logical, integer, character) |
keep_variables |
Logical, should the names of the sample variables being used, be kept in the phyloseq objects? |
keep_empty |
Logical, should sample data combinations applying to no samples be kept? If
|
extract_list |
Logical, if |
... |
Ignored |
If only one variable is provided, the element of the phyloseq column is named after this column
A tibble where the variables are in the in the first columns, while the last column is named phyloseq
and contains the corresponding objects. If extract_list=TRUE, only this last column is returned.
phyloseq and contains the phyloseq object correspodning to the specific combination of sample variables.
library(phyloseq)
data("soilrep")
subdivide_by_environment(soilrep,variables=c('Treatment','warmed','clipped'),
keep_variables=FALSE,keep_empty=FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.