View source: R/ps_otu2samdat.R
ps_otu2samdat | R Documentation |
Copy phyloseq otu_table data to sample_data
ps_otu2samdat(ps, taxa = NULL)
ps |
phyloseq with sample_data |
taxa |
list of taxa_names to copy to sample_data, or NULL (which selects all with |
phyloseq with augmented sample_data
library(phyloseq)
data("dietswap", package = "microbiome")
ps <- dietswap %>% ps_otu2samdat("Akkermansia")
sample_variables(ps)
# or if you do not specify any taxa, all are copied
ps_all <- dietswap %>% ps_otu2samdat()
sample_variables(ps_all)[1:15]
# this could be useful for colouring ordination plots, for example
ps %>%
ps_mutate(log_akkermansia = log(Akkermansia)) %>%
dist_calc("bray") %>%
ord_calc(method = "PCoA") %>%
ord_plot(
colour = "log_akkermansia",
size = 3, shape = "nationality"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.