nst | R Documentation |
Calculate NST for each group
nst(otutab, group_df, threads = 1, file = NULL, rep = 20, save = FALSE)
otutab |
an otutab data.frame, samples are columns, taxs are rows. |
group_df |
a dataframe with rowname and one group column |
threads |
default:4 |
file |
filename to save |
rep |
repeat numbers: suggest 999 |
save |
save the file |
a b_dist object, dis is MSTij
Ning, D., Deng, Y., Tiedje, J. M. & Zhou, J. (2019) A general framework for quantitatively assessing ecological stochasticity. Proceedings of the National Academy of Sciences 116, 16892–16898.
if (requireNamespace("NST")) {
library(ggplot2)
data(otutab, package = "pcutils")
nst(otutab, metadata["Group"]) -> nst_res
plot(nst_res, c_group = "intra") + geom_hline(yintercept = 0.5, lty = 2) + ylab("NST")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.