transform_tern_to_cart(T, L, R, data = data.frame(T = T, L = L, R = R), ...,
Tlim = c(0, 1), Llim = c(0, 1), Rlim = c(0, 1), scale = TRUE)trytransform(data, coord)
data.frame
containing
columns T
, L
and R
. If not specified
(Default), it will be produced from the T
,
L
and R
parameters for use in the
functtransform_tern_to_cart
returns a data.frame
object with columns x
and y
representing the
transformed coordinates, and, number of rows equal to that
of the data
argument. In other words, a '1 to 1'
transformation from the ternary to the cartesian space.trytransform
returns a data.frame
object
regardless of the success of the function operation.
transform_tern_to_cart(...)
is a function that
takes input numeric vectors for the T
, L
and R
species, or, alternatively, a data.frame
with columns T
, L
and R
(Mandatory
Column Names), and, transforms the data from the ternary
space, to the cartesian space where x
and y
are in the range [0,1]
and [0,$sin(\pi/3)$]
respectively. The limits for T
, L
and
R
MAY NOT NECESSARILY be in the range
[0,1]
, however, this is the default range. Since the constituents of each ternary points must sum to
1.0
, the user has the option to scale the data so
that this is satisfied. Negative values may be of
interest when trying to determine the coordinates of a
point 'outside' of the ternary plot surface, however,
they must still sum to unity.
Custom Limits can be applied for T
, L
and
R
species (by the parameters Tlim
,
Llim
and Rlim
, respectively), however, if
they are non-standard (ie [0,1]), then checks are made so
that non-sensical results are not implied and, an error
will be thrown if such non-sensical results exist, IE,
All points MUST sum to unity given that the axis
extremes should meet at the vertices of the plot area.
By the above statement, the following constraints must
hold TRUE
:
min(Llim) + min(Rlim) = 1
ANDmin(Tlim)
+ max(Llim) +
min(Rlim) = 1
ANDmin(Tlim) +
min(Llim)
+ max(Rlim) = 1trytransform
is an internal function which
attempts to make ternary transformation. If fails, the
original data is returned.