clo {compositions}R Documentation

Closure of a composition

Description

Closes compositions to sum up to one (or an optional total), by dividing each part by the sum.

Usage

          clo( X, parts=1:NCOL(oneOrDataset(X)),total=1)
          

Arguments

X composition or dataset of compositions
parts vector containing the indices xor names of the columns to be used
total the total amount to which the compositions should be closed; either a single number, or a numeric vector of length gsi.getN(X) specifying a different total for each compositional vector in the dataset.

Details

The closure operation is given by

clo(x) := ( x_i / sum(x_j))

clo makes a composition without assigning one of the compositional classes acomp or rcomp. Note that after computing the closed-to-one version, obtaining a version closed to any other value is done by simple multiplication.

Value

a composition or a datamatrix of compositions without compositional class. The individual compositions are forced to sum to 1 (or to the optionally-specified total). The result should have the same shape as the input (vector, row, matrix).

Note

clo can be used to unclass compositions.

Author(s)

K.Gerald v.d. Boogaart http://www.stat.boogaart.de, Raimon Tolosana-Delgado

References

Aitchison, J. (1986) The Statistical Analysis of Compositional Data Monographs on Statistics and Applied Probability. Chapman & Hall Ltd., London (UK). 416p.

See Also

clr,acomp,rcomp

Examples

(tmp <- clo(c(1,2,3)))
clo(tmp,total=100)
data(Hydrochem)
cdata <- Hydrochem[,6:19]
plot( clo(Hydrochem,8:9) ) # Giving points on a line 


[Package compositions version 0.9-11 Index]