transforms: Transforms

Description Usage Arguments Details Value References Examples

Description

Transformations appropriate for ecological data.

Usage

1
2
3
4
5
6
7
asin_sqrt(x, ...)

genlogtrans(x, ...)

pseudo_log(x, sigma = 1, backtransform = FALSE)

standardize(x, from = 0, to = 1, na.rm = TRUE, ...)

Arguments

x

vector or array of values to transform.

...

further arguments passed to other methods.

sigma

numeric, curvature scale factor for pseudo-log transform.

backtransform

logical, perform pseudo-log backward transformation? Default 'backtransform = FALSE' gives the forward transformation.

from, to

standardizes from low to high values; default is from 0 to 1.

na.rm

logical, should missing values (including 'NaN') be removed?

Details

asin_sqrt = Arc-sine square root transform:
Appropriate for vegetation cover and other proportion data. Forces data to 0-1 scale if any original values were outside this range. Follows pg. 69 of McCune & Grace (2002).

genlogtrans = Generalized log-transform:
Log transform for non-negative values, preserves original order of magnitudes while properly handling values = 0 and << 1. Follows pg. 69 of McCune & Grace (2002).

pseudo_log = Pseudo-logarithmic transform:
Log-like transformation for positive and negative values. Useful for color scales. Change sigma to vary curvature/linearity around zero.

standardize = Range standardize:
Standardizes data to 0-1 scale based on min/max values.

Value

Values on the modified scale.

References

McCune, B., and J. B. Grace. 2002. Analysis of Ecological Communities. MjM Software, Gleneden Beach, Oregon, USA. 304 pp.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
set.seed(21)
x  <- (rbeta(99, 0.5, 1) - 0.15) * 100
x1 <- asin_sqrt(x)    # forces 0-1 scale
x2 <- genlogtrans(x)  # only for non-negative values, negative become NaN
x3 <- pseudo_log(x)   # handles positive and negative values
x4 <- standardize(x)  # forces 0-1 scale
par(mfrow=c(2,2))
plot(x, x1)
plot(x, x2)
plot(x, x3)
plot(x, x4)
par(mfrow=c(1,1))

phytomosaic/ecole documentation built on Jan. 2, 2022, 11:24 p.m.