Group components of a composition

Share:

Description

Adds several components of a composition together into a single component

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
amalgamate(X, ...)

## Default S3 method:
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

1
2
3
4
5
6
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))

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.