Learn R Programming

robCompositions (version 2.0.0)

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), 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
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.

References

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

See Also

ternary

Examples

Run this code

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)

Run the code above in your browser using DataLab