Learn R Programming

provenance (version 1.3)

amalgamate: Group components of a composition

Description

Adds several components of a composition together into a single component

Usage

amalgamate(X, ...)

## S3 method for class 'default': amalgamate(X, ...)

## S3 method for class 'compositional': amalgamate(X, ...)

## S3 method for class 'SRDcorrected': amalgamate(X, ...)

Arguments

X
a compositional dataset
...
a series of new labels assigned to strings or vectors of strings denoting the components that need amalgamating

Value

  • an object of the same class as X with fewer components

Examples

Run this code
data(Namib)
HMcomponents <- c("zr","tm","rt","TiOx","sph","ap","ep",
                  "gt","st","amp","cpx","opx")
am <- amalgamate(Namib$PTHM,feldspars=c("KF","P"),
                 lithics=c("Lm","Lv","Ls"),heavies=HMcomponents)
plot(ternary(am))

Run the code above in your browser using DataLab