tidy_pcoa | R Documentation |
Perform PCoA in a "tidy" way. If multiple diversity metrics are provided (eg., "bray" and "jaccard"), all PCoA results will be combined into one data.frame.
tidy_pcoa( df, taxon_col, sample_col, abundance_col, dists = c("bray", "jaccard", "wunifrac", "unifrac"), tree = NULL, threads = 1, threads_unifrac = 1, k = 2, dist_mtx_file = NULL, pcoa_file = NULL )
df |
data.frame or tibble |
taxon_col |
the column specifying taxa or OTUs (no quotes needed) |
sample_col |
the column specifying sample names (no quotes needed) |
abundance_col |
the column specifying the taxon abundances in each sample (no quotes needed) |
dists |
vector of beta-diversity distances ('wunifrac' = weighted UniFrac, 'unifrac' = unweighted Unifrac; see vegan::vegsist for others) |
tree |
phylogeny for UniFrac calculations. It can have more tips that what is in the data.frame |
threads |
number of parallel calculations of each distance metric (1 thread per distance) |
threads_unifrac |
number of threads to use for wunifrac & unifrac calculations |
k |
passed to cmdscale |
dist_mtx_file |
file name for saving the distance matrices (qs serialization; use ".qs" for the file extension) |
pcoa_file |
file name for saving the raw pcoa results |
Weighted/Unweighted UniFrac is calculated via the rbiom R package. All other beta-diversity metrics are calculated via the vegan R package.
a tibble of PCoA info for all selected "dists"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.