test_wreg: Testing the relationship species attributes and sample...

Description Usage Arguments Details Value See Also Examples

Description

Function calculating the weightet linear regressions between CWM of species attributes (traits) and sample attributes (environmental variables) and between SNC of sample attributes and species attributes (sensu ter Braak et al. 2018), and testing them by parametric tests and their combination into max test.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
test_wreg(
  env,
  com = NULL,
  traits = NULL,
  test = "all",
  parallel = NULL,
  p.adjust.method = p.adjust.methods,
  adjustP = FALSE
)

## S3 method for class 'testWREG'
print(
  x,
  digits = max(3, getOption("digits") - 3),
  missing.summary = FALSE,
  eps.Pvalue = 0.001,
  signif.stars = getOption("show.signif.stars"),
  ...
)

## S3 method for class 'testWREG'
coef(object, ...)

rescale_axis(x, var_re, var_st)

## S3 method for class 'testWREG'
plot(
  x,
  alpha = 0.05,
  line = NA,
  cex.lab = 1.5,
  par.mar = c(0.5, 0.5, 0.5, 0.5),
  box.col = c("blue", "red"),
  box.lwd = 2,
  ...
)

Arguments

env

Vector, matrix or data frame with sample attributes (environemntal variables).

com

Matrix of data frame with species composition data.

traits

Vector, matrix or data frame with species attributes (traits)

test

NEEDS FIX Vector of character values. Which test should be conducted? Partial match to 'rowbased' row-based permutation test (called Model 2 in the Legendre et al. 1997 and Dray & Legendre 2008), 'colbased' for column-based permutation test (Model 4), and 'max' for max test (selecting the higher from rowbased and colbased result, Model 6). 'all' includes all three tests. See Details.

parallel

NULL (default) or integer number. Number of cores for parallel calculation. Maximum number of cores should correspond to number of available cores on the processor.

p.adjust.method

A string indicating the method of P-value adjustement, see p.adjust.methods for possible choices.

adjustP

Logical, default FALSE. Should be the P-values adjusted? If adjustP = TRUE, the last column in the results is adjusted by method selected in p.adjust.method.

x, object

NEEDS FIX object of the class "cwm", generated by function cwm.

digits

number of digits reported by print method on object of "cwm" class (default is 3).

missing.summary

Logical; should be the summary of values missing in env, cwm and traits be printed along to the result of test_cwm analysis? Default is TRUE.

eps.Pvalue

Values of P below this threshold will be printed as < [eps] in the output.

signif.stars

Logical; if TRUE, P-values are additionally encoded visually as 'significance stars' in order to help scanning of long coefficient tables. It defaults to the show.signif.stars slot of options.

...

Other arguments for print, summary or coef functions (not implemented yet).

var_re, var_st

Parameters for scaling function rescale_axis

alpha, line, cex.lab, par.mar, box.col, box.lwd

Graphical parameters for plot function.

Details

In the current implementation, species with missing species attributes are removed from sample x species matrix prior to permutation of species attributes among species.

Value

Function test_wreg returns the list of the class "testWREG" (with print and summary methods), which contains the following items: NEEDS TO FIX

See Also

cwm test_cwm

Examples

1
2
3
4
5
data (vltava)
vltava.env <- vltava$env[,c('pH', 'COVERE32')]
vltava.com <- vltava$herbs$spe
vltava.traits <- vltava$herbs$traits
wreg <- test_wreg (env = vltava.env, com = vltava.com, traits = vltava.traits)

zdealveindy/weimea documentation built on Sept. 21, 2021, 2:15 p.m.