mantel_test: Mantel test

Description Usage Arguments Value Author(s) See Also Examples

View source: R/mantel-test.R

Description

Mantel and partial mantel test for dissimilarity matrices

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
mantel_test(
  spec,
  env,
  group = NULL,
  env.ctrl = NULL,
  mantel.fun = "mantel",
  spec.select = NULL,
  env.select = NULL,
  use = "everything",
  spec.dist.method = "bray",
  env.dist.method = "euclidean",
  seed = 123,
  ...
)

Arguments

...

extra params passing to mantel.fun.

spec, env

data frame object.

group

vector for grouping the rows.

env.ctrl

NULL (default), data frame.

mantel.fun

string, function of mantel test.

  • "mantel" will use vegan::mantel() (default).

  • "mantel.randtest" will use ade4::mantel.randtest().

  • "mantel.rtest" will use ade4::mantel.rtest().

  • "mantel.partial" will use vegan::mantel.partial() (default).

spec.select, env.select

NULL (default), numeric or character vector index of columns.

use

one of "everything", "complete" or "pairwise".

spec.dist.method

dissimilarity index (default is 'bray'), passing to method params of vegan::vegdist.

env.dist.method

dissimilarity index (default is euclidean'), passing to method params of vegan::vegdist().

seed

a integer value.

Value

a data.frame.

Author(s)

Houyun Huang, Lei Zhou, Jian Chen, Taiyun Wei

See Also

mantel_test.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
library(vegan)
data("varespec")
data("varechem")
mantel_test(varespec, varechem,
  spec.select = list(spec01 = 1:5, spec02 = 6:12))
mantel_test(varespec, varechem,
  spec.select = list(spec01 = 1:5, spec02 = 6:12),
  env.select = list(env01 = 1:5, env02 = 6:10, env03 = 11:14))
set.seed(20191224)
sam_grp <- sample(paste0("sample", 1:3), 24, replace = TRUE)
mantel_test(varespec, varechem, group = sam_grp)

## End(Not run)

houyunhuang/ggcor documentation built on July 22, 2020, 8:31 p.m.