Learn R Programming

ggcor (version 0.9.8.1)

fortify_mantel: Mantel test

Description

Mantel and partial mantel test for dissimilarity matrices

Usage

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.

See Also

mantel_test.

Examples

Run this code
# 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)
# }

Run the code above in your browser using DataLab