Learn R Programming

compositions (version 0.9-11)

groupparts: Group amounts of parts

Description

Groups parts by amalgamation or balancing of their amounts or proportions.

Usage

groupparts(x,...)
## S3 method for class 'acomp':
groupparts(x,\dots,groups=list(...))
## S3 method for class 'rcomp':
groupparts(x,\dots,groups=list(...))
## S3 method for class 'aplus':
groupparts(x,\dots,groups=list(...))
## S3 method for class 'rplus':
groupparts(x,\dots,groups=list(...))

Arguments

x
an amount/compositional dataset
...
further parameters to use (actually ignored)
groups
a list of numeric xor character vectors, each giving a group of parts

Value

  • a new dataset of the same type with each group represented by a single column

Details

In the real geometry grouping is done by amalgamation (i.e. adding the parts). In the Aitchison-geometry grouping is done by taking geometric means. The new parts are named by named formal arguments. Not-mentioned parts remain ungrouped.

References

Egozcue, J.J. and V. Pawlowsky-Glahn (2005) Groups of Parts and their Balances in Compositional Data Analysis, Mathematical Geology, in press

See Also

aplus

Examples

Run this code
data(SimulatedAmounts)
groupparts(acomp(sa.lognormals5),A=c(1,2),B=c(3,4),C=5)
groupparts(aplus(sa.lognormals5),B=c(3,4),C=5)
groupparts(rcomp(sa.lognormals5),A=c("Cu","Pb"),B=c(2,5))
groupparts(rplus(sa.lognormals5),1:5)

Run the code above in your browser using DataLab