Learn R Programming

provenance (version 4.4)

text.ternary: Ternary text plotting

Description

Add text an existing ternary diagram

Usage

# S3 method for ternary
text(x, labels = 1:nrow(x$x), ...)

Arguments

x

an object of class ternary, or a three-column data frame or matrix

labels

a character vector or expression specifying the text to be written

...

optional arguments to the generic text function

Examples

Run this code
data(Namib)
tern <- ternary(Namib$Major,'CaO','Na2O','K2O')
plot(tern,pch=21,bg='red',labels=NULL)
# add the geometric mean composition as a text label:
gmean <- ternary(exp(colMeans(log(tern$x))))
text(gmean,labels='geometric mean')

Run the code above in your browser using DataLab