Calculate correlation for one or two t(otutab), or distance for one t(otutab).

c_net_calculate(
  totu,
  totu2 = NULL,
  method = "spearman",
  filename = FALSE,
  p.adjust.method = NULL,
  p.adjust.mode = "all",
  threads = 1,
  verbose = TRUE
)

Arguments

totu

t(otutab), row are samples, column are features.

totu2

t(otutab2) or NULL, row are samples, column are features.

method

"spearman" (default), "pearson", "sparcc", or distance index from vegdist.

filename

the prefix of saved .corr file or FALSE.

p.adjust.method

see p.adjust

p.adjust.mode

see p.adjust.table

threads

threads, default: 1.

verbose

verbose, default: TRUE.

Value

a corr object with 3 elements:

r

default: spearman correlation

p.value

default: p-value of spearman correlation

p.adjust

default p.adjust.method = NULL

See also

Other calculate: cal_sim(), fast_cor(), p.adjust.table(), read_corr()

Examples

data("otutab", package = "pcutils")
t(otutab) -> totu
c_net_calculate(totu) -> corr
metadata[, 3:10] -> env
c_net_calculate(totu, env) -> corr2
#> All samples matched.
#> All features are OK.