Cohesion calculation

Plot cohesion

Cohesion(otutab, reps = 200, threads = 1, mycor = NULL, verbose = TRUE)

# S3 method for class 'cohesion'
plot(x, group, metadata, mode = 1, ...)

Arguments

otutab

otutab

reps

iteration time

threads

threads

mycor

a correlation matrix you want to use, skip the null model build when mycor is not NULL, default: NULL

verbose

verbose

x

Cohesion() result (cohesion object)

group

group name in colnames(metadata)

metadata

metadata

mode

plot mode, 1~2

...

additional arguments for group_box (mode=1) or group_box (mode=2)

Value

Cohesion object: a list with two dataframe

a ggplot

References

Herren, C. M. & McMahon, K. (2017) Cohesion: a method for quantifying the connectivity of microbial communities. doi:10.1038/ismej.2017.91.

Examples

# \donttest{
data("otutab", package = "pcutils")
# set reps at least 99 when you run.
Cohesion(otutab[1:50, ], reps = 19) -> cohesion_res
if (requireNamespace("ggpubr")) {
  plot(cohesion_res, group = "Group", metadata = metadata, mode = 1)
  plot(cohesion_res, group = "Group", metadata = metadata, mode = 2)
}
#> Loading required namespace: ggpubr
# }