Learn R Programming

MDM (version 1.3)

dev2div: Converts deviances to diversities

Description

Takes either (1) a mdm or (2) a scaler, vector or matrix of deviances, and extracts or converts then to diverities. The relationship between deviance (dev) and diversity (d) is given by div = exp(dev/2/n) where n is the number of units (typically rows of a matrix) over which deviance is being averaged.

Usage

dev2div(x, n)

Arguments

x
a mdm or a scaler, vector or matrix of deviances.
n
if x is not a mdm, then the divisor in the conversion as defined as above.

Value

The diversity of x.

See Also

ed, ed1, eds, eds1

Examples

Run this code
x <- c(5,10,15)
dev2div(x,n=10)

Run the code above in your browser using DataLab