Learn R Programming

ggtern (version 1.0.5.0)

Tline: Add constant lines

Description

In ggplot2, one can add horizontal and vertical lines via the geom_hline and geom_vline prototypes, and these are the analogue in the ternary space, however, they are not 'horizontal' or 'vertical' as such, rather, lines for constant values of one of the three species.

Usage

Tline(Tintercept = NULL, ...)

Lline(Lintercept = NULL, ...)

Rline(Rintercept = NULL, ...)

geom_Lline(mapping = NULL, data = NULL, stat = "Lline", position = "identity", show_guide = FALSE, ...)

geom_Rline(mapping = NULL, data = NULL, stat = "Rline", position = "identity", show_guide = FALSE, ...)

geom_Tline(mapping = NULL, data = NULL, stat = "Tline", position = "identity", show_guide = FALSE, ...)

stat_Lline(mapping = NULL, data = NULL, geom = "Lline", position = "identity", Lintercept, ...)

stat_Rline(mapping = NULL, data = NULL, geom = "Rline", position = "identity", Rintercept, ...)

stat_Tline(mapping = NULL, data = NULL, geom = "Tline", position = "identity", Tintercept, ...)

Arguments

Tintercept
for geom_Tline and stat_Tline, the constant value of the THS apex constituent.
Lintercept
for geom_Lline and stat_Lline, the constant value of the LHS apex constituent.
Rintercept
for geom_Rline and stat_Rline, the constant value of the RHS apex constituent.
...
other arguments passed on to layer. This can include aesthetics whose values you want to set, not map. See layer for more details.
mapping
The aesthetic mapping, usually constructed with aes or aes_string. Only needs to be set at the layer level if you are overriding the plot defaults.
data
A layer specific dataset - only needed if you want to override the plot defaults.
stat
The statistical transformation to use on the data for this layer.
position
The position adjustment to use for overlapping points on this layer
show_guide
should a legend be drawn? (defaults to FALSE)
geom
The geometric object to use display the data

Tline, Lline and Rline

Convenience functions, Tline(...), Lline(...) and Rline(...) (or the aliasses tline(...), lline(...) and rline(...), respectively) have been created so that constant lines can be quickly created:

Aesthetics

[results=rd,stage=build]{ggtern:::rd_aesthetics("geom", "Tline")} [results=rd,stage=build]{ggtern:::rd_aesthetics("geom", "Lline")} [results=rd,stage=build]{ggtern:::rd_aesthetics("geom", "Rline")}

The statistical transformations hold the following aesthetic requirements:

[results=rd,stage=build]{ggtern:::rd_aesthetics("stat", "Tline")} [results=rd,stage=build]{ggtern:::rd_aesthetics("stat", "Lline")} [results=rd,stage=build]{ggtern:::rd_aesthetics("stat", "Rline")} ggtern() + geom_Lline(Lintercept=0.50,color="red") + Lline(0.25,color="green")