PlotTernary | R Documentation |
PlotTernary
plots in a triangle the values of three variables. Useful for mixtures
(chemistry etc.).
PlotTernary(x, y = NULL, z = NULL, args.grid = NULL, lbl = NULL, main = "",...)
x |
vector of first variable. Will be placed on top of the triangle. |
y |
vector of second variable (the right corner). |
z |
vector of third variable (on the left corner). |
args.grid |
list of additional arguments for the grid. Set this argument to |
main |
overall title for the plot. |
lbl |
the labels for the corner points. Default to the names of x, y, z. |
... |
the dots are sent to |
Andri Signorell <andri@signorell.net> based on example code by W. N. Venables and B. D. Ripley mentioned
J. Aitchison (1986) The Statistical Analysis of Compositional Data. Chapman and Hall, p.360.
Venables, W. N. and Ripley, B. D. (2002) Modern Applied Statistics with S. Fourth edition. Springer.
example in Skye
# some random data in three variables
c1 <- runif(25)
c2 <- runif(25)
c3 <- runif(25)
# basic plot
par(mfrow=c(1, 2))
PlotTernary(c1, c2, c3, args.grid=NA)
## Not run:
# plot with different symbols and a grid using a dataset from MASS
data(Skye, package="MASS")
PlotTernary(Skye[c(1,3,2)], pch=15, col=DescTools::hred, main="Skye",
lbl=c("A Sodium", "F Iron", "M Magnesium"))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.