Permanova between a otutab and a variable

Permanova between a otutab and a variable (added two)

permanova(
  otutab,
  envs,
  norm = TRUE,
  each = TRUE,
  method = "adonis",
  dist = "bray",
  two = FALSE,
  nperm = 999,
  ...
)

permanova(
  otutab,
  envs,
  norm = TRUE,
  each = TRUE,
  method = "adonis",
  dist = "bray",
  two = FALSE,
  nperm = 999,
  ...
)

Arguments

otutab

an otutab data.frame, samples are columns, taxs are rows.

envs

factors need to test

norm

should normalize?(default:TRUE)

each

test factor one by one, rather than whole

method

adonis/mrpp/anosim/mantel

dist

if use pcoa or nmds, your can choose a dist method (default: bray)

two

two by two adonis test

nperm

numbers of permutations to perform

...

additional

Value

a g_test object with these columns

group

the test group or factor

r

relationship

r2

model R-square

p_value

model test p_value

sig

whether significant

Examples

data(otutab, package = "pcutils")
permanova(otutab, metadata[, c(2:10)]) -> adonis_res
print(adonis_res)
#>   group     r2 p_value   sig
#> 1 Group 0.1843   0.001  TRUE
#> 2  env1 0.0769   0.044  TRUE
#> 3  env2 0.0624   0.304 FALSE
#> 4  env3 0.0766   0.041  TRUE
#> 5  env4 0.1157   0.001  TRUE
#> 6  env5 0.0966   0.007  TRUE
#> 7  env6 0.0600   0.371 FALSE
#> 8   lat 0.0582   0.449 FALSE
#> 9  long 0.0529   0.760 FALSE
plot(adonis_res)