Learn R Programming

nexus (version 0.3.0)

scale: Scaling and Centering of Compositional Data

Description

Scaling and Centering of Compositional Data

Usage

# S4 method for CompositionMatrix
scale(x, center = TRUE, scale = TRUE)

Value

A CompositionMatrix object.

Arguments

x

A CompositionMatrix object.

center

A logical scalar or a numeric vector giving the center to be substracted.

scale

A logical scalar or a length-one numeric vector giving a scaling factor for multiplication.

Author

N. Frerebeau

References

Aitchison, J. (1986). The Statistical Analysis of Compositional Data. London: Chapman and Hall, p. 64-91.

Boogaart, K. G. van den & Tolosana-Delgado, R. (2013). Analyzing Compositional Data with R. Berlin Heidelberg: Springer-Verlag. tools:::Rd_expr_doi("10.1007/978-3-642-36809-7").

See Also

Other statistics: aggregate(), condense(), covariance(), dist, mahalanobis(), margin(), mean(), pip(), quantile(), variance(), variance_total(), variation()

Examples

Run this code
## Data from Aitchison 1986
data("hongite")

## Coerce to compositional data
coda <- as_composition(hongite)

## Center and scale
scaled <- scale(coda, center = TRUE, scale = TRUE)
mean(scaled)
head(scaled)

Run the code above in your browser using DataLab