tritrafo | R Documentation |
Function to carry out the transformation into 2D space
for triplot
, trilines
etc.
tritrafo(x, y = NULL, z = NULL, check = TRUE, tolerance = 0.0001)
x |
Vector of fractions of first component
OR 3-column matrix containing all three components (omitting |
y |
(optional) vector of fractions of second component. |
z |
(optional) vector of fractions of third component. |
check |
if |
tolerance |
tolerance for above sum check. |
Projects the mixture given by x
, y
, and z
with x
, y
, z
between one and zero and x+y+z=1
into
a two-dimensional space.
For further details see triplot
.
A matrix with two columns corresponding to the two dimensions.
Christian Röver, roever@statistik.tu-dortmund.de
triplot
, tripoints
, trilines
, trigrid
tritrafo(0.1, 0.2, 0.7)
tritrafo(0.1, 0.2, 0.6) # warning
triplot()
points(tritrafo(0.1, 0.2, 0.7), col="red")
tripoints(0.1, 0.2, 0.7, col="green") # the same
tritrafo(c(0.1,0.2), c(0.3,0.4), c(0.6,0.4))
tritrafo(diag(3))
point <- c(0.25,0.6,0.15)
triplot(point, pch=16)
text(tritrafo(point), "(0.25, 0.60, 0.15)", adj=c(0.5,2)) # add a label
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.