Learn R Programming

rioja (version 1.0-7)

utils: Utility functions.

Description

Utility functions to perform simple computations, transformations, formatting etc.

Usage

make.dummy(fact)

dummy2factor(x)

Hill.N2(df, margin=2)

site.summ(y, max.cut=c(2, 5, 10, 20))

sp.summ(y, n.cut=c(5, 10, 20))

Value

make.dummy returns a matrix of dummay variables. dummy2factor returns a factor.

Hill.N2 returns a numeric vector of N2 values.

sp.summ returns a matrix with columns for the number of occurences, Hill's N2 and maximum abundance of each species, and the number of occurences at abundance greater than the cut levels given in n.cut.

sam.summ returns a matrix with columns for the number of taxa, Hill's N2, maximum value and site total of each site (sample), and the number of taxa in each site with abundance greater than the cut levels given in max.cut.

Arguments

fact

a factor to convert to a matrix of dummy variables.

x

a matrix or data frame of dummy variables to convert to a factor.

df

a data frame of species abundance data.

margin

margin to calculate over: 1 = by rows, 2 = by columns.

y

data frame or matrix of species by sites data.

n.cut

cut levels of abundance for species summary (see below).

max.cut

cut levels of occurence for species sumamry.

Author

Steve Juggins

Details

Function make.dummy converts a factor into a matrix of dummy (1/0) variables. dummy2factor converts a matrix or data frame of dummy variables into a factor.

Function Hill.N2 returns Hill's N2 values for species or samples for a given species by sites dataset (Hill 1973).

References

Hill, M.O. (1973) Diversity and evenness: a unifying notation and its consequences. Ecology, 54, 427-432.