ps_reorder | R Documentation |
Manually set order of samples by specifying samples names in desired order.
ps_reorder(ps, sample_order)
ps |
phyloseq |
sample_order |
names or current numerical indices of samples in desired order |
Ordering of samples in a phyloseq is controlled from the otu_table slot!
phyloseq
ps_arrange
for arranging samples by sample_data variables (or otu_table)
ps_seriate
for arranging samples by microbiome similarity
ps_filter
for keeping only some samples, based on sample_data
library(phyloseq)
data("dietswap", package = "microbiome")
dietswap %>%
sample_data() %>%
head(8)
new_order <- rev(sample_names(dietswap))
dietswap %>%
ps_reorder(new_order) %>%
sample_data() %>%
head(8)
# random ordering with numbers
set.seed(1000)
random_order <- sample(1:nsamples(dietswap))
dietswap %>%
ps_reorder(random_order) %>%
sample_data() %>%
head(8)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.