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

Description Usage Arguments Details Value See Also Examples

View source: R/test_fourth.R

Description

Function calculating fourth corner analysis between sample attributes (environmental variables) and species attributes (traits) and testing it by row based, column based or max permutation test.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
test_fourth(env, com = NULL, traits = NULL, cwm = NULL, perm = 499,
  test = "max", parallel = NULL, p.adjust.method = p.adjust.methods,
  adjustP = FALSE)

## S3 method for class 'testFOURTH'
print(x, digits = max(3, getOption("digits") - 3),
  missing.summary = FALSE, ...)

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

## S3 method for class 'testFOURTH'
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)

cwm

An object of the class cwm.

perm

Number of permutations.

test

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 of modified permutation test. 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

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.

...

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

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

Graphical parameters for plot function.

Details

Environmental variables, species composition and traits can be provided in two ways: either each object separately, using arguments env, com and traits, or using only env and cwm; in the later case, the function extract is used to extract the com and traits from the cwm object. Specific issue related to weighted mean is the case of missing species attributes. In 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_fourth returns the list of the class "testFOURTH" (with print and summary methods), which contains the following items:

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
fc <- test_fourth (env = vltava.env, com = vltava.com, traits = vltava.traits)

zdealveindy/weimea documentation built on June 14, 2018, 3:45 a.m.