amalgamate: Group components of a composition

View source: R/toolbox.R

amalgamateR Documentation

Group components of a composition

Description

Adds several components of a composition together into a single component

Usage

amalgamate(x, ...)

## Default S3 method:
amalgamate(x, ...)

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

## S3 method for class 'counts'
amalgamate(x, ...)

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

## S3 method for class 'varietal'
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

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))

provenance documentation built on May 29, 2024, 4:23 a.m.