ps_arrange | R Documentation |
Uses information in the sample_data or tax_table of phyloseq object to set the order of the samples (sample_data or tax_table specified by .target arg)
Give this function arguments in the same way you would use dplyr::arrange()
ps_arrange(ps, ..., .target = "sample_data")
ps |
phyloseq object |
... |
dots passed directly to dplyr::arrange() |
.target |
arrange samples by "sample_data" variables or "otu_table" taxa abundances |
phyloseq
arrange
data("dietswap", package = "microbiome")
dietswap %>%
ps_arrange(subject, timepoint) %>%
phyloseq::sample_data() %>%
head(8)
ps <- dietswap %>% ps_arrange(subject, desc(timepoint))
phyloseq::sample_data(ps) %>% head(8)
phyloseq::otu_table(ps)[1:8, 1:8]
# you can also arrange samples by the abundances of taxa in the otu tables
pst <- dietswap %>% ps_arrange(desc(Akkermansia), .target = "otu_table")
phyloseq::otu_table(pst)[1:8, 1:8]
phyloseq::sample_data(pst) %>% head(8)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.