snc: Weighted mean of sample attributes - species niche centroids...

Description Usage Arguments Details Value Author(s) Examples

Description

NEEDS TO REWRITE!!! Function snc calculates weighted mean of sample attributes, using matrix of species composition (com) and one or several sample attributes (env).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
snc(com, env, wstand = FALSE)

is.snc(object)

## S3 method for class 'snc'
object[i, j]

## S3 method for class 'snc'
as.matrix(x, ...)

## S3 method for class 'snc'
summary(object, long = F, ...)

## S3 method for class 'snc'
print(x, ...)

## S3 method for class 'snc'
extract(x, what = "env", ...)

Arguments

com

Matrix or data.frame with species composition matrix (samples x species)

env

Vector, matrix or data.frame with env. variables (samples x env). This can be numeric or factor.

wstand

Logical. Should be the values in env weighted-standardized prior to calculation of SNC? Weights are row sums in species composition matrix com.

object, x

Object of the class snc

i, j

Subscripts of the matrix of the class "snc" (rows and columns).

...

Other arguments passed into as.matrix, summary or print function. Currently not supported.

long

should summary return long output? (TRUE vs FALSE)

what

Attributes extracted from the object of class snc; either env for the matrix of sample attributes (samples x env), or com for matrix of species composition (samples x species).

Details

Function [.snc] is for extracting specified rows and columns from matrix of class snc. As a side effect, resulting object will have concatenated the com and env attributes to match the dimension of the resulting matrix. This function is only for extracting the parts of snc object, not for replacing; attempt to replace will work, but will break the inner structure.

Generic function extract with argument what applied on object of class "snc" extracts the original species composition matrix or sample attribute matrix, respectively, which were used to calculate weighted means.

Value

Object of class "snc", which has print, summary, as.matrix and '[.' methods. Object of "snc" class contains the matrix of calculated weighted means of sample attributes (species niche centroids) for each species (species x snc) and three attributes: com, species x sample matrix from which the weighted mean was calculated, env, samples x env. variables matrix with sample attributes, and wstand, logical value specifying whether env.variables were weighted-standardized prior to calculation of SNC (weights are row sums of com). All weighted means of sample attributes must be based on the same species x sample matrix with the same number of species.

Author(s)

David Zeleny (zeleny.david@gmail.com)

Examples

1
2
3
4
5
6
7
8
9
# Calculation of weighted mean of species Ellenberg indicator values using dataset Vltava
data (vltava)
mean.env <- snc(com = vltava$spe, env = vltava$env[, c('ELEVATION', 'pH')])

summary (mean.env)

# Extracting values from the object of \code{snc} class
mean.env[,1]
mean.env[1:10, 1]

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