y2p: Scale rows of a species-sites data set

Description Usage Arguments Value Examples

View source: R/y2p.R

Description

The response matrix for mdm diversity analyses requires that species (columns of the data matrix) are scaled to proportions i.e. that they sum to one for each site (row of the data matrix). Two matrices are particularly useful; these correspond to alpha and gamma diversities. The former is particularly useful for mdm anovas that include the alpha model which is computationally expensive using the function mdm.

Usage

1

Arguments

y

matrix or data frame of numeric values to be transformed

mean

if mean = TRUE then each row is replaced by the species means scaled to row sums of one

Value

A matrix of the same dimensions as the input matrix. Each row of the matrix will sum to one.

Examples

1
2
3
mydata <- matrix(0:8,nrow=3,ncol=3)
mydata
y2p(mydata)

MDM documentation built on May 30, 2017, 4:58 a.m.