a b/man/Cohesion.Rd
1
% Generated by roxygen2: do not edit by hand
2
% Please edit documentation in R/7.stability.R
3
\name{Cohesion}
4
\alias{Cohesion}
5
\alias{plot.cohesion}
6
\title{Cohesion calculation}
7
\usage{
8
Cohesion(otutab, reps = 200, threads = 1, mycor = NULL, verbose = TRUE)
9
10
\method{plot}{cohesion}(x, group, metadata, mode = 1, ...)
11
}
12
\arguments{
13
\item{otutab}{otutab}
14
15
\item{reps}{iteration time}
16
17
\item{threads}{threads}
18
19
\item{mycor}{a correlation matrix you want to use, skip the null model build when mycor is not NULL, default: NULL}
20
21
\item{verbose}{verbose}
22
23
\item{x}{\code{Cohesion()} result (cohesion object)}
24
25
\item{group}{group name in colnames(metadata)}
26
27
\item{metadata}{metadata}
28
29
\item{mode}{plot mode, 1~2}
30
31
\item{...}{additional arguments for \code{\link[pcutils]{group_box}} (mode=1) or \code{\link[pcutils]{group_box}} (mode=2)}
32
}
33
\value{
34
Cohesion object: a list with two dataframe
35
36
a ggplot
37
}
38
\description{
39
Cohesion calculation
40
41
Plot cohesion
42
}
43
\examples{
44
\donttest{
45
data("otutab", package = "pcutils")
46
# set reps at least 99 when you run.
47
Cohesion(otutab[1:50, ], reps = 19) -> cohesion_res
48
if (requireNamespace("ggpubr")) {
49
  plot(cohesion_res, group = "Group", metadata = metadata, mode = 1)
50
  plot(cohesion_res, group = "Group", metadata = metadata, mode = 2)
51
}
52
}
53
}
54
\references{
55
Herren, C. M. & McMahon, K. (2017) Cohesion: a method for quantifying the connectivity of microbial communities. doi:10.1038/ismej.2017.91.
56
}