Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ternaryDiag

Ternary diagram


Description

This plot shows the relative proportions of three variables (compositional parts) in one diagramm. Before plotting, the data are scaled.

Usage

ternaryDiag(
  x,
  name = colnames(x),
  text = NULL,
  grid = TRUE,
  gridCol = grey(0.6),
  mcex = 1.2,
  line = "none",
  robust = TRUE,
  group = NULL,
  tol = 0.975,
  ...
)

Arguments

x

matrix or data.frame with 3 columns

name

names of the variables

text

default NULL, text for each point can be provided

grid

if TRUE a grid is plotted additionally in the ternary diagram

gridCol

color for the grid lines

mcex

label size

line

may be set to “none”, “pca”, “regression”, “regressionconf”, “regressionpred”, “ellipse”, “lda”

robust

if line equals TRUE, it dedicates if a robust estimation is applied or not.

group

if line equals “da”, it determines the grouping variable

tol

if line equals “ellipse”, it determines the parameter for the tolerance ellipse

...

further parameters, see, e.g., par()

Details

The relative proportions of each variable are plotted.

Author(s)

Peter Filzmoser <P.Filzmoser@tuwien.ac.at>, Matthias Templ

References

Reimann, C., Filzmoser, P., Garrett, R.G., Dutter, R. (2008) Statistical Data Analysis Explained. Applied Environmental Statistics with R. John Wiley and Sons, Chichester.

See Also

Examples

data(arcticLake)
ternaryDiag(arcticLake)

data(coffee)
x <- coffee[,2:4]
grp <- as.integer(coffee[,1])
ternaryDiag(x, col=grp, pch=grp)
ternaryDiag(x, grid=FALSE, col=grp, pch=grp)
legend("topright", legend=unique(coffee[,4]), pch=1:2, col=1:2)

ternaryDiag(x, grid=FALSE, col=grp, pch=grp, line="ellipse", tol=c(0.975,0.9), lty=2)
ternaryDiag(x, grid=FALSE, line="pca")
ternaryDiag(x, grid=FALSE, col=grp, pch=grp, line="pca", lty=2, lwd=2)

robCompositions

Compositional Data Analysis

v2.3.0
GPL (>= 2)
Authors
Matthias Templ [aut, cre] (<https://orcid.org/0000-0002-8638-5276>), Karel Hron [aut] (<https://orcid.org/0000-0002-1847-6598>), Peter Filzmoser [aut] (<https://orcid.org/0000-0002-8014-4682>), Kamila Facevicova [ctb], Petra Kynclova [ctb], Jan Walach [ctb], Veronika Pintar [ctb], Jiajia Chen [ctb], Dominika Miksova [ctb], Bernhard Meindl [ctb], Alessandra Menafoglio [ctb] (<https://orcid.org/0000-0003-0682-6412>), Alessia Di Blasi [ctb], Federico Pavone [ctb], Gianluca Zeni [ctb]
Initial release
2020-11-18

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.