Description Usage Arguments Value Examples
View source: R/microbiome_tools.R
This function outputs a data.frame of pairwise distances from
each pair of samples contained in a phyloseq
object.
1 2 3 | make_distance_df(ps = ps, distances = c("wuf", "uuf", "bray", "jsd",
"jaccard"), force_distance_calculations = FALSE, intragroup_only = FALSE,
variables = NULL)
|
ps |
A |
distances |
A vector of distances metrics you want included.
Defaults to c("wuf", "uuf", "bray", "jsd", "jaccard").
If the distance matrix is alrady present in the global enviroment,
it will not calculate it again unless |
force_distance_calculations |
(Logical) Would you like the function to overwrite any distance matrices in the global enviroment? Defaults to FALSE |
intragroup_only |
(Logical)
If you would like to restrict comparisions to within a group,
you can set this as TRUE (defaults to "Subject_ID") or you
can specify which column in |
variables |
A vector of |
This function returns a data.frame with every pair of samples and their distance by several distance metrics. It can also output variables, as well as comparisions between those variables for easy subsetting.
1 2 3 4 5 | df <- make_distance_df(ps = ps)
df <- make_distance_df(ps = ps,
distances = c("jsd", "jaccard"),
intragroup_only = "Subject_ID",
variables = c("Country", "Age_Months"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.