nst: Calculate NST for each group

View source: R/eco_micro.R

nstR Documentation

Calculate NST for each group

Description

Calculate NST for each group

Usage

nst(otutab, group_df, threads = 1, file = NULL, rep = 20, save = FALSE)

Arguments

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

Value

a b_dist object, dis is MSTij

References

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.

Examples


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")
}


pctax documentation built on May 29, 2024, 10:03 a.m.