Functions to transform data from the ternary to cartesian spaces and vice-versa.
tlr2xy
transforms from the ternary to cartesian spaces, an inverse transformation
transforms between cartesian to ternary spaces
xy2tlr
transforms from the cartesian to ternary spaces, an inverse transformation
transforms between ternary to cartesian spaces, it is the reciprocal to tlr2xy
, therefore
an inverse transformation in xy2tlr
function is the same as the forward
transformation in tlr2xy
tlr2xy(data, coord, ..., inverse = FALSE, scale = TRUE, drop = FALSE)xy2tlr(data, coord, ..., inverse = FALSE, scale = TRUE)
data.frame
containing columns as required by the coordinate system.
Data will be scaled so that the rows sum to unity, in the event that the user has provided
data that does not.CoordTern
class, error will
be thrown if a different coordinate system is sent to this methoddata(Feldspar) dfm = plyr::rename(Feldspar,c("Ab"="x","An"="y","Or"="z")) crd = coord_tern() fwd = tlr2xy(dfm,crd) rev = tlr2xy(fwd,crd,inverse = TRUE)