Draws the strings given in the vector labels at the coordinates given by
x, y and z.
Arguments
- x, y, z
A
numericvector giving the x, y and z ternary coordinates of a set of points. Ifyandzare missing, an attempt is made to interpretxin a suitable way (seegrDevices::xyz.coords()).- ...
Further arguments to be passed to
graphics::text().- center
A
logicalscalar specifying wether the data should be centered, or anumericvector giving the center.- scale
A
logicalscalar specifying wether the data should be scaled, or anumericvector giving the scale factor.- labels
A
charactervector orexpressionspecifying the text to be written.
See also
Other geometries:
ternary_arrows(),
ternary_crosshairs(),
ternary_image(),
ternary_labels(),
ternary_lines(),
ternary_points(),
ternary_polygon(),
ternary_segments()
Examples
## Compositional data
coda <- data.frame(
X = c(20, 60, 20),
Y = c(20, 20, 60),
Z = c(60, 20, 20)
)
## Add text
ternary_plot(NULL, panel.first = ternary_grid())
ternary_text(coda, labels = c("A", "B", "C"), col = "red", cex = 2)
