Learn R Programming

rgr (version 1.1.15)

gx.eb: Computation of Empirical Balances

Description

Computes empirical balances (ratios) for the stated columns of a n by p matrix of compositional data.

Usage

gx.eb(r, s, xx, ...)

Arguments

r

number of parts in the numerator.

s

number of parts in the denominator.

xx

matrix for which the balances for the stated columns will be computed.

...

the column indices of the parts in the numerator, followed by the column indices for the parts in the denominator. The total number of indices must equal the sum of r and s.

Value

z

the vector of n balances.

References

Egozcue, J.J. & Pawlowsky-Glahn, V., 2005. Groups of Parts and Their Balances in Compositional Data Analysis. Mathematical Geology, 37(7):795-828.

See Also

ltdl.fix.df

Examples

Run this code
# NOT RUN {
## Make test data available
data(sind.mat2open)

## Compute and display empirical balances for columns 1, 5 & 4 
## of the data vs. columns 2 & 3
temp <- gx.eb(3, 2, sind.mat2open, 1, 5, 4, 2, 3)
shape(temp, "Zn.Cu.Cd/Fe.Mn balance")

## Clean-up
rm(sind.mat2open)
rm(temp)
# }

Run the code above in your browser using DataLab