Package `ggtern`

Package `ggtern`
Package ‘ggtern’
January 16, 2016
Type Package
Title An Extension to 'ggplot2', for the Creation of Ternary Diagrams
Version 2.0.1
Date 2016-1-1
Description Extends the functionality of 'ggplot2', providing the capability
to plot ternary diagrams for (subset of) the 'ggplot2' geometries. Additionally,
'ggtern' has implemented several NEW geometries which are unavailable to the
standard 'ggplot2' release. For further examples and documentation, please
proceed to the 'ggtern' website.
Depends ggplot2 (>= 2.0.0)
Imports compositions, grid, gridExtra, gtable (>= 0.1.1), latex2exp
(>= 0.3.3), MASS, plyr (>= 1.7.1), scales (>= 0.3.0), stats,
proto, utils, lattice
Enhances sp
License GPL-2
URL http://www.ggtern.com
LazyData true
Collate 'ggtern-package.R' 'aes.R' 'coord-tern.R' 'calc-tern-tlr2xy.R'
'calc-mahalanobis-distance.R' 'calc-kde2d-weighted.R'
'doc-data.R' 'doc-theme-convenience.R' 'depreciated.R'
'labels-new.R' 'labels-percent.R' 'ggtern-constructor.R'
'gg-internal.R' 'modifications-gridExtra.R' 'onLoad.R' 'plot.R'
'plot-build.R' 'plot-construction.R' 'position-.R'
'position-nudge-tern.R' 'position-jitter-tern.R' 'save.R'
'scales-.R' 'scales-tern.R' 'strip-unapproved.R'
'tern-limits.R' 'theme.R' 'theme-arrowlength.R'
'theme-clockwise.R' 'theme-defaults.R' 'theme-elements.R'
'theme-gridsontop.R' 'theme-legend-position.R'
'theme-noarrows.R' 'theme-novar-tern.R' 'theme-rotate.R'
'theme-showgrid.R' 'theme-showlabels.R' 'theme-showsecondary.R'
'theme-showtitles.R' 'theme-ticksoutside.R' 'utilities.R'
'utilities-help.R' 'geom-density-tern.R' 'stat-density-tern.R'
1
R topics documented:
2
'geom-mask.R' 'geom-Xline.R' 'geom-Xisoprop.R'
'geom-confidence-tern.R' 'stat-confidence-tern.R'
'geom-errorbarX.R' 'geom-smooth-tern.R' 'stat-smooth-tern.R'
'geom-interpolate-tern.R' 'stat-interpolate-tern.R'
NeedsCompilation no
Author Nicholas Hamilton [aut, cre]
Maintainer Nicholas Hamilton <[email protected]>
Repository CRAN
RoxygenNote 5.0.1
Date/Publication 2016-01-16 18:53:29
R topics documented:
+.gg . . . . . . . . . .
aes . . . . . . . . . . .
approved_layers . . . .
arrangeGrob . . . . . .
convenience_functions
coord_tern . . . . . . .
data_sets_Feldspar . .
data_sets_Fragments .
data_sets_USDA . . .
geom_confidence_tern
geom_density_tern . .
geom_errorbarX . . . .
geom_interpolate_tern
geom_mask . . . . . .
geom_smooth_tern . .
geom_Xisoprop . . . .
geom_Xline . . . . . .
ggsave . . . . . . . . .
ggtern . . . . . . . . .
ggtern_labels . . . . .
ggtern_package . . . .
ggtern_themes . . . . .
label_formatter . . . .
mahalanobis_distance .
position_jitter_tern . .
position_nudge_tern .
scale_T_continuous . .
stat_density_tern . . .
suffix_arrow . . . . . .
ternary-transformation
tern_limits . . . . . . .
theme . . . . . . . . .
themearrowlength . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
3
3
4
6
7
8
9
10
12
13
15
16
19
21
21
23
24
26
27
27
29
31
33
34
34
35
35
36
38
39
40
41
43
+.gg
3
theme_clockwise . . .
theme_complete . . . .
theme_gridsontop . . .
theme_legend_position
theme_noarrows . . . .
theme_novar_tern . . .
theme_rotate . . . . .
theme_showgrid . . . .
theme_showlabels . . .
theme_showprimary . .
theme_showtitles . . .
theme_ticksoutside . .
zzz-depreciated . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Index
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
45
45
46
46
47
47
48
49
50
50
52
52
53
56
+.gg
Plot Construction
Description
"+.gg" is a local copy of the ggplot2 add function, no change other than exporting from the ggtern
namespace
Usage
## S3 method for class 'gg'
e1 + e2
Arguments
e1
first object
e2
second object
aes
Modified Aesthetic Mappings
Description
An extension to the base aes functin from ggplot2, this is modified to handle a default z mapping
for application in ternary phase diagrams. Does not alter the standard behaviour.
Usage
aes(x, y, z, ...)
4
approved_layers
Arguments
x
x value
y
y value
z
z value
...
other arguments as per aes
See Also
Parent aes function.
approved_layers
Approved Geoms, Stats and Positions
Description
ggtern is a specialist extension to ggplot2 for rendering ternary diagrams, as such, many stats and
geoms which come packaged with ggplot2 are either not relevant or will not work, as such, ggtern
regulates during the plot construction process, which geoms and stats are able to be applied when
using the coord_tern coordinate system. Attempting to apply non-approved geometries or stats (ie
geometries / stats not in the below list), will result in the respective layers being stripped from the
final plot.
Approved Geometries
The following geoms have been approved so far, including a combination of existing geoms and
newly created geoms for the ggtern package APPROVED geoms in ggtern are as follows:
• geom_point
• geom_path
• geom_line
• geom_label
• geom_text
• geom_jitter
• geom_Tline
• geom_Rline
• geom_Lline
• geom_polygon
• geom_segment
• geom_count
• geom_errorbarT
• geom_errorbarL
• geom_errorbarR
approved_layers
5
• geom_density_tern
• geom_confidence
• geom_curve
• geom_mask
• geom_smooth_tern
• geom_blank
• geom_jitter
• geom_Tisoprop
• geom_Lisoprop
• geom_Risoprop
• geom_interpolate_tern
Approved Stats
The following stats have been approved so far, including a combination of existing stats and newly
created stats for the ggtern package APPROVED stats in ggtern are as follows:
• stat_identity
• stat_confidence
• stat_density_tern
• stat_smooth_tern
• stat_sum
• stat_unique
• stat_interpolate_tern
Approved Positions
The following positions have been approved so far, including a combination of existing positions
and newly created positions for the ggtern package APPROVED positions in ggtern are as follows:
• position_identity
• position_nudge_tern
• position_jitter_tern
The balance of the available stats, geometries or positions within ggplot2 are either invalid or remain
work in progress with regards to the ggtern package.
Author(s)
Nicholas Hamilton
6
arrangeGrob
arrangeGrob
Arrange multiple grobs on a page (ggtern version)
Description
A very slight modification to the original function, removing the explicit direction to use the ggplotGrob function from the ggplot2 namespace
Usage
arrangeGrob(..., grobs = list(...), layout_matrix, vp = NULL,
name = "arrange", as.table = TRUE, respect = FALSE, clip = "off",
nrow = NULL, ncol = NULL, widths = NULL, heights = NULL, top = NULL,
bottom = NULL, left = NULL, right = NULL, padding = unit(0.5, "line"))
grid.arrange(..., newpage = TRUE)
Arguments
...
grobs, gtables, ggplot or trellis objects
grobs
list of grobs
layout_matrix
optional layout
vp
viewport
name
argument of gtable
as.table
logical: bottom-left to top-right or top-left to bottom-right
respect
argument of gtable
clip
argument of gtable
nrow
argument of gtable
ncol
argument of gtable
widths
argument of gtable
heights
argument of gtable
top
optional string, or grob
bottom
optional string, or grob
left
optional string, or grob
right
optional string, or grob
padding
unit of length one, margin around annotations
newpage
open a new page
convenience_functions
7
convenience_functions Theme Convenience Functions
Description
ggtern has made available a number of convenience functions for rapid tweaking of the various
theme elements, for a full list of the available theme elements which can be manually modified, see
HERE.
Convenience Functions
Convenience functions that ship with ggtern, to assist in the rapid modification of key theme elements:
• Show/Hide Axis Titles
• Show/Hide Arrows
• Show/Hide Grids
• Show/Hide Primary/Secondary Ticks
• Show/Hide Axis Ticklabels
• Clockwise/Anticlockwise Axis Precession
• Ticks Inside or Outside of the Main Plot Area
• Atomic or Weight Percent Arrow Label Suffix.
• Rotate the plot by X degrees or radians
Manual Modification
For manual modification on a per-element basis:
• Ternary Theme Elements
Default Themes
Default (complete) themes which ship with ggtern:
• Complete Themes
Examples
#Load data and create the base plot.
data(Feldspar)
plot <- ggtern(data=Feldspar,aes(x=An,y=Ab,z=Or)) + geom_point() + theme_bw()
plot
#Show or Hide Arrows
last_plot() + theme_showarrows()
last_plot() + theme_hidearrows()
8
coord_tern
#Major/Minor Grids?
last_plot() + theme_nogrid_minor()
last_plot() + theme_nogrid_major()
last_plot() + theme_showgrid()
last_plot() + theme_nogrid()
#Clockwise/Anticlockwise Precession
last_plot() + theme_clockwise()
last_plot() + theme_anticlockwise()
#Ticks Inside or Outside
last_plot() + theme_ticksoutside()
last_plot() + theme_ticksinside()
#Show/Hide BOTH Primary and Secondary Ticks
last_plot() + theme_showticks()
last_plot() + theme_hideticks()
#Show/Hide EITHER Primary OR Secondary Ticks.
last_plot() + theme_showprimary() + theme_hidesecondary()
last_plot() + theme_hideprimary() + theme_showsecondary()
#Atomic / Weight Percent
last_plot() + theme_showarrows() + atomic_percent()
last_plot() + theme_showarrows() + weight_percent()
last_plot() + theme_showarrows() + custom_percent("Atomic Percent")
#Rotation
last_plot() + theme_rotate(30)
coord_tern
Ternary Coordinate System
Description
coord_tern is a function which creates a transformation mechanism between the ternary system,
and, the cartesian system. It inherits from the fixed coordinate system, employing fixed ratio between x and y axes once transformed.
Usage
coord_tern(Tlim = NULL, Llim = NULL, Rlim = NULL, expand = TRUE)
CoordTern
Arguments
Tlim
the range of T in the ternary space
data_sets_Feldspar
9
Llim
the range of L in the ternary space
Rlim
the range of R in the ternary space
expand
If TRUE, the default, adds a small expansion factor to the limits to ensure that
data and axes don’t overlap. If FALSE, limits are taken exactly from the data or
xlim/ylim.
Format
An object of class CoordTern (inherits from CoordCartesian, Coord, ggproto) of length 8.
Value
coord_tern returns a CoordTern ggproto
Aesthetics (Required in Each Layer)
coord_tern understands the following aesthetics (required aesthetics are in bold):
•
Abovementioned limitations include the types of geometries which can be used (ie approved geometries), or modifications to required aesthetic mappings. One such essential patch is, for approved
geometries previously requiring x and y coordinates, now require an additional z coordinate, and,
geom_segment goes one step further in that it requires both an additional z and zend coordinate
mappings.
In essence, the required aesthetics are the product between what is required of each ’layer’ and what
is required of the ’coordinate system’.
Author(s)
Nicholas Hamilton
data_sets_Feldspar
Elkin and Groves Feldspar Data
Description
This dataset represents the experiments conducted by Elkins and Groves
Usage
data(Feldspar)
Format
One (1) row per Feldspar composition
10
data_sets_Fragments
Author(s)
Nicholas Hamilton
References
Elkins, L. T. & Grove, T. L. Ternary Feldspar Experiments and Thermodynamic Models American
Mineralogist, Mineral Soc America, 1990, 75, 544-559
See Also
ggtern datasets
Examples
data(Feldspar)
summary(Feldspar)
ggtern(data=Feldspar,aes(x=An,y=Ab,z=Or)) + geom_point()
data_sets_Fragments
Grantham and Valbel Rock Fragment Data
Description
ABSTRACT: Chemical weathering influences the detrital composition of sand-size sediment derived from source areas subject to different amounts of precipitation in the Coweeta Basin, North
Carolina. Of the grain types studied, rock fragments are most sensitive to chemical degradation;
therefore, their abundance is the best indicator of cumulative weathering effects. Destruction of
sand-size rock fragments by chemical weathering is a function of both the intensity and duration of
chemical weathering experienced by grains in regoliths of the source area. In the Coweeta Basin,
the intensity of chemical weathering is directly related to the climate via effective precipitation in
individual subbasins, whereas the duration of chemical weathering is inversely related to the relief
ratio of the watershe . Therefore, soils in watersheds with low-relief ratios and high discharge per
unit area experience the most extensive chemical weathering, and sediments derived from these
watersheds contain the lowest percentage of rock fragments. The effects of climate alone cannot
explain the systematic variation of rock fragment abundance in sediments from the Coweeta Basin.
The compositional imprint left on these sediments by chemical weathering is a function of both
climate and topographic slope in the sediment source area.
Usage
data(Fragments)
data_sets_Fragments
11
Format
1row per point, Each point contains data on the following:
1. Watershed: By id: 2, 10, 34, 41, 13, 27, 32 or 37,
2. Position: By name: Tallulah or Coweeta,
3. CCWI: The Cumulative Chemical Weathering Index: numeric
4. Precipitation: Average Annual Precipitation, numeric
5. Discharge: Annual Average Discharge, numeric
6. Relief: Relief Ratio, numeric
7. GrainSize: Coarse Medium or Fine,
8. Sample: Field Sampling, A, B or C
9. Points: The number of points measured for each sample
10. Qm: Multicrystalline Quarts Amount, percentage
11. Qp: Polycrystalline Quarts Amount, percentage
12. Rf: Rock Fragments Amount, percentage
13. M: Mica Amount, percentage
Author(s)
Jeremy Hummon Grantham and Michael Anthony Velbel
References
Grantham, Jeremy Hummon, and Michael Anthony Velbel. "The influence of climate and topography on rock-fragment abundance in modern fluvial sands of the southern Blue Ridge Mountains,
North Carolina." Journal of Sedimentary Research 58.2 (1988).
Examples
data(Fragments)
ggtern(Fragments,aes(Qm+Qp,Rf,M,colour=Sample)) +
geom_density_tern(h=2,aes(fill=..level..),expand=0.75,alpha=0.5) +
geom_point(aes(shape=Position,size=Relief)) +
theme_bw() + theme_showarrows() + custom_percent('%') +
labs(title = "Grantham and Valbel Rock Fragment Data",
x = "Q_m+Q_p", xarrow = "Quartz (Multi + Poly)",
y = "R_f",
yarrow = "Rock Fragments",
z = "M",
zarrow = "Mica") +
facet_wrap(~Sample,nrow=2)
12
data_sets_USDA
data_sets_USDA
USDA Textural Classification Data
Description
This dataset was issued by the United States Department of Agriculture (USDA) in the form of a
ternary diagram, this original ternary diagram has been converted to numerical data and included
here.
Usage
data(USDA)
Format
1row per point, many points per classification representing the extremes of the area.
Author(s)
United States Department of Agriculture (USDA)
Nicholas Hamilton
Source
Soil Mechanics Level 1, Module 3, USDA Textural Classification Study Guide
See Also
ggtern datasets
Examples
#Load the Libraries
library(ggtern)
library(plyr)
#Load the Data.
data(USDA)
#Put tile labels at the midpoint of each tile.
USDA.LAB <- ddply(USDA,"Label",function(df){apply(df[,1:3],2,mean)})
#Tweak
USDA.LAB$Angle=0; USDA.LAB$Angle[which(USDA.LAB$Label == "Loamy Sand")] = -35
#Construct the plot.
ggtern(data=USDA,aes(Sand,Clay,Silt,color=Label,fill=Label)) +
geom_polygon(alpha=0.75,size=0.5,color="black") +
geom_mask() +
geom_text(data=USDA.LAB,aes(label=Label,angle=Angle),color="black",size=3.5) +
theme_rgbw() +
theme_showsecondary() +
theme_showarrows() +
geom_confidence_tern
13
weight_percent() + guides(fill='none') +
theme_legend_position("topleft")
labs(title="USDA Textural Classification Chart",fill="Textural Class",color="Textural Class")
geom_confidence_tern
Confidence Interval
Description
Calculates the confidence intervals, via the Mahalnobis Distance and use of the Log-Ratio Transformation
Usage
geom_confidence_tern(mapping = NULL, data = NULL, stat = "ConfidenceTern",
position = "identity", lineend = "butt", linejoin = "round",
linemitre = 1, na.rm = FALSE, show.legend = NA, inherit.aes = TRUE,
...)
stat_confidence_tern(mapping = NULL, data = NULL, geom = "ConfidenceTern",
position = "identity", contour = TRUE, n = 100, h = NULL,
na.rm = FALSE, breaks = c(0.5, 0.9, 0.95), show.legend = NA,
inherit.aes = TRUE, ...)
Arguments
mapping
Set of aesthetic mappings created by aes or aes_. If specified and inherit.aes = TRUE
(the default), is combined with the default mapping at the top level of the plot.
You only need to supply mapping if there isn’t a mapping defined for the plot.
data
A data frame. If specified, overrides the default data frame defined at the top
level of the plot.
stat
The statistical transformation to use on the data for this layer, as a string.
position
Position adjustment, either as a string, or the result of a call to a position adjustment function.
lineend
Line end style (round, butt, square)
linejoin
Line join style (round, mitre, bevel)
linemitre
Line mitre limit (number greater than 1)
na.rm
If FALSE (the default), removes missing values with a warning. If TRUE silently
removes missing values.
show.legend
logical. Should this layer be included in the legends? NA, the default, includes if
any aesthetics are mapped. FALSE never includes, and TRUE always includes.
inherit.aes
If FALSE, overrides the default aesthetics, rather than combining with them.
This is most useful for helper functions that define both data and aesthetics and
shouldn’t inherit behaviour from the default plot specification, e.g. borders.
14
geom_confidence_tern
...
other arguments passed on to layer. There are three types of arguments you
can use here:
• Aesthetics: to set an aesthetic to a fixed value, like color = "red" or
size = 3.
• Other arguments to the layer, for example you override the default stat
associated with the layer.
• Other arguments passed on to the stat.
geom
Use to override the default connection between geom_smooth and stat_smooth.
contour
If TRUE, contour the results of the 2d density estimation
n
number of grid points in each direction
h
Bandwidth (vector of length two). If NULL, estimated using bandwidth.nrd.
breaks
the confidence intervals, default to 50, 90 and 95 percent.
Aesthetics
geom_ConfidenceTern understands the following aesthetics (required aesthetics are in bold):
• x
• y
• alpha
• colour
• linetype
• size
Computed variables
Same as stat_contour
Author(s)
Nicholas Hamilton
Examples
data(Feldspar)
ggtern(data=Feldspar,aes(An,Ab,Or)) + geom_point() + geom_confidence_tern()
geom_density_tern
geom_density_tern
15
Density Estimate
Description
Perform a 2D kernel density estimatation using kde2d and display the results with contours. This
can be useful for dealing with overplotting. Additional weight aesthetic (see aesthetic section below) permits better weighting if desired
Usage
geom_density_tern(mapping = NULL, data = NULL, stat = "DensityTern",
position = "identity", lineend = "butt", linejoin = "round",
linemitre = 1, na.rm = FALSE, show.legend = NA, inherit.aes = TRUE,
...)
Arguments
mapping
Set of aesthetic mappings created by aes or aes_. If specified and inherit.aes = TRUE
(the default), is combined with the default mapping at the top level of the plot.
You only need to supply mapping if there isn’t a mapping defined for the plot.
data
A data frame. If specified, overrides the default data frame defined at the top
level of the plot.
stat
The statistical transformation to use on the data for this layer, as a string.
position
Position adjustment, either as a string, or the result of a call to a position adjustment function.
lineend
Line end style (round, butt, square)
linejoin
Line join style (round, mitre, bevel)
linemitre
Line mitre limit (number greater than 1)
na.rm
If FALSE (the default), removes missing values with a warning. If TRUE silently
removes missing values.
show.legend
logical. Should this layer be included in the legends? NA, the default, includes if
any aesthetics are mapped. FALSE never includes, and TRUE always includes.
inherit.aes
If FALSE, overrides the default aesthetics, rather than combining with them.
This is most useful for helper functions that define both data and aesthetics and
shouldn’t inherit behaviour from the default plot specification, e.g. borders.
...
other arguments passed on to layer. There are three types of arguments you
can use here:
• Aesthetics: to set an aesthetic to a fixed value, like color = "red" or
size = 3.
• Other arguments to the layer, for example you override the default stat
associated with the layer.
• Other arguments passed on to the stat.
16
geom_errorbarX
Aesthetics
geom_density_tern understands the following aesthetics (required aesthetics are in bold):
• x
• y
• alpha
• colour
• linetype
• size
• weight
Author(s)
Nicholas Hamilton
Examples
data(Feldspar); Feldspar$weight= 0*c(1:nrow(Feldspar))^2
ggtern(Feldspar,aes(Ab,An,Or,weight=weight)) +
geom_density_tern(aes(colour=..level..),expand=0.5,base='identity')
geom_errorbarX
Ternary Error Bars
Description
geom_errorbarT, geom_errorbarL and geom_errorbarR are geometries to render error bars for
the top, left and right apex species respectively, analogous to geom_errorbar and/or geom_errorbarh
as provided in the base ggplot2 package.
Usage
geom_errorbarT(mapping = NULL, data = NULL, stat = "identity",
position = "identity", arrow = NULL, lineend = "butt", na.rm = FALSE,
show.legend = NA, inherit.aes = TRUE, ...)
geom_errorbarL(mapping = NULL, data = NULL, stat = "identity",
position = "identity", arrow = NULL, lineend = "butt", na.rm = FALSE,
show.legend = NA, inherit.aes = TRUE, ...)
geom_errorbarR(mapping = NULL, data = NULL, stat = "identity",
position = "identity", arrow = NULL, lineend = "butt", na.rm = FALSE,
show.legend = NA, inherit.aes = TRUE, ...)
GeomErrorbart
geom_errorbarX
17
GeomErrorbarl
GeomErrorbarr
Arguments
mapping
Set of aesthetic mappings created by aes or aes_. If specified and inherit.aes = TRUE
(the default), is combined with the default mapping at the top level of the plot.
You only need to supply mapping if there isn’t a mapping defined for the plot.
data
A data frame. If specified, overrides the default data frame defined at the top
level of the plot.
stat
The statistical transformation to use on the data for this layer, as a string.
position
Position adjustment, either as a string, or the result of a call to a position adjustment function.
arrow
specification for arrow heads, as created by arrow()
lineend
Line end style (round, butt, square)
na.rm
If FALSE (the default), removes missing values with a warning. If TRUE silently
removes missing values.
show.legend
logical. Should this layer be included in the legends? NA, the default, includes if
any aesthetics are mapped. FALSE never includes, and TRUE always includes.
inherit.aes
If FALSE, overrides the default aesthetics, rather than combining with them.
This is most useful for helper functions that define both data and aesthetics and
shouldn’t inherit behaviour from the default plot specification, e.g. borders.
...
other arguments passed on to layer. There are three types of arguments you
can use here:
• Aesthetics: to set an aesthetic to a fixed value, like color = "red" or
size = 3.
• Other arguments to the layer, for example you override the default stat
associated with the layer.
• Other arguments passed on to the stat.
Format
An object of class GeomErrorbart (inherits from GeomSegment, Geom, ggproto) of length 3.
Aesthetics (geom_errorbarT)
geom_errorbart understands the following aesthetics (required aesthetics are in bold):
• Tmax
• Tmin
• x
• y
• z
18
geom_errorbarX
•
•
•
•
alpha
colour
linetype
size
Aesthetics (geom_errorbarL)
geom_errorbarl understands the following aesthetics (required aesthetics are in bold):
•
•
•
•
•
•
•
•
•
Lmax
Lmin
x
y
z
alpha
colour
linetype
size
Aesthetics (geom_errorbarR)
geom_errorbarr understands the following aesthetics (required aesthetics are in bold):
•
•
•
•
•
•
•
•
•
Rmax
Rmin
x
y
z
alpha
colour
linetype
size
Examples
#Example with Dummy Data.
tmp <- data.frame(x=1/3,
y=1/3,
z=1/3,
Min=1/3-1/6,
Max=1/3+1/6)
ggtern(data=tmp,aes(x,y,z)) +
geom_point() +
geom_errorbarT(aes(Tmin=Min,Tmax=Max),colour='red')+
geom_errorbarL(aes(Lmin=Min,Lmax=Max),colour='green')+
geom_errorbarR(aes(Rmin=Min,Rmax=Max),colour='blue')
geom_interpolate_tern
19
geom_interpolate_tern Ternary Interpolation
Description
This is the heavily requested geometry for interpolating between ternary values, results being rendered using contours on a ternary mesh.
Usage
geom_interpolate_tern(mapping = NULL, data = NULL,
stat = "InterpolateTern", position = "identity", method = "auto",
lineend = "butt", linejoin = "round", linemitre = 1, na.rm = FALSE,
show.legend = NA, inherit.aes = TRUE, formula = value ~ poly(x, y,
degree = 1), ...)
stat_interpolate_tern(mapping = NULL, data = NULL,
geom = "InterpolateTern", position = "identity", method = "auto",
na.rm = FALSE, show.legend = NA, inherit.aes = TRUE, n = 80,
formula = value ~ poly(x, y, degree = 1), ...)
StatInterpolateTern
Arguments
mapping
Set of aesthetic mappings created by aes or aes_. If specified and inherit.aes = TRUE
(the default), is combined with the default mapping at the top level of the plot.
You only need to supply mapping if there isn’t a mapping defined for the plot.
data
A data frame. If specified, overrides the default data frame defined at the top
level of the plot.
stat
The statistical transformation to use on the data for this layer, as a string.
position
Position adjustment, either as a string, or the result of a call to a position adjustment function.
method
smoothing method (function) to use, eg. lm, glm, gam, loess, rlm. For datasets
with n < 1000 default is loess. For datasets with 1000 or more observations
defaults to gam, see gam for more details.
lineend
Line end style (round, butt, square)
linejoin
Line join style (round, mitre, bevel)
linemitre
Line mitre limit (number greater than 1)
na.rm
If FALSE (the default), removes missing values with a warning. If TRUE silently
removes missing values.
show.legend
logical. Should this layer be included in the legends? NA, the default, includes if
any aesthetics are mapped. FALSE never includes, and TRUE always includes.
20
geom_interpolate_tern
inherit.aes
If FALSE, overrides the default aesthetics, rather than combining with them.
This is most useful for helper functions that define both data and aesthetics and
shouldn’t inherit behaviour from the default plot specification, e.g. borders.
formula
formula to use in smoothing function, eg. y ~ x, y ~ poly(x, 2), y ~ log(x)
...
other arguments passed on to layer. There are three types of arguments you
can use here:
• Aesthetics: to set an aesthetic to a fixed value, like color = "red" or
size = 3.
• Other arguments to the layer, for example you override the default stat
associated with the layer.
• Other arguments passed on to the stat.
geom
Use to override the default connection between geom_smooth and stat_smooth.
n
number of grid points in each direction
Format
An object of class StatInterpolateTern (inherits from Stat, ggproto) of length 6.
Aesthetics
geom_InterpolateTern understands the following aesthetics (required aesthetics are in bold):
• x
• y
• alpha
• colour
• linetype
• size
Examples
data(Feldspar)
ggtern(Feldspar,aes(Ab,An,Or,value=T.C)) +
stat_interpolate_tern(geom="polygon",
formula=value~x+y,
method=lm,n=100,
breaks=seq(0,1000,by=100),
aes(fill=..level..),expand=1) +
geom_point()
geom_mask
geom_mask
21
Apply Manual Clipping Mask
Description
This function creates a manual clipping mask, which in turn suppresses the standard clipping mask
that would otherwise be rendered in the foregound rendering procedure, giving the user control
over the exact placement with respect to other layers. For example, the user may wish to have the
clipping mask placed after the geom_point(...) layer, but before the geom_label(...) layer,
this situation has been demonstrated in the example below. In the event that the user wishes to
suppress the mask altogether, then a convenience function has been provided, theme_nomask().
Usage
geom_mask()
Author(s)
Nicholas Hamilton
Examples
data(Feldspar)
x = ggtern(Feldspar,aes(Ab,An,Or,label=Experiment)) + geom_point()
#Default Behaviour
x + geom_label()
#Insert manual mask before the labels, to prevent them being truncated
x + geom_point(size=6) + geom_mask() + geom_label()
geom_smooth_tern
Add a Smoothed Conditional Mean.
Description
Aids the eye in seeing patterns in the presence of overplotting. geom_smooth_tern and stat_smooth_tern
are effectively aliases: they both use the same arguments. Use geom_smooth_tern unless you want
to display the results with a non-standard geom.
22
geom_smooth_tern
Usage
geom_smooth_tern(mapping = NULL, data = NULL, method = "auto",
formula = y ~ x, se = TRUE, position = "identity", na.rm = FALSE,
show.legend = NA, inherit.aes = TRUE, expand = c(0.5, 0.5), ...)
stat_smooth_tern(mapping = NULL, data = NULL, position = "identity",
method = "auto", formula = y ~ x, se = TRUE, n = 80, span = 0.75,
fullrange = FALSE, level = 0.95, method.args = list(), na.rm = FALSE,
show.legend = NA, inherit.aes = TRUE, expand = c(0.5, 0.5), ...)
Arguments
mapping
Set of aesthetic mappings created by aes or aes_. If specified and inherit.aes = TRUE
(the default), is combined with the default mapping at the top level of the plot.
You only need to supply mapping if there isn’t a mapping defined for the plot.
data
A data frame. If specified, overrides the default data frame defined at the top
level of the plot.
method
smoothing method (function) to use, eg. lm, glm, gam, loess, rlm. For datasets
with n < 1000 default is loess. For datasets with 1000 or more observations
defaults to gam, see gam for more details.
formula
formula to use in smoothing function, eg. y ~ x, y ~ poly(x, 2), y ~ log(x)
se
display confidence interval around smooth? (TRUE by default, see level to control
position
Position adjustment, either as a string, or the result of a call to a position adjustment function.
na.rm
If FALSE (the default), removes missing values with a warning. If TRUE silently
removes missing values.
show.legend
logical. Should this layer be included in the legends? NA, the default, includes if
any aesthetics are mapped. FALSE never includes, and TRUE always includes.
inherit.aes
If FALSE, overrides the default aesthetics, rather than combining with them.
This is most useful for helper functions that define both data and aesthetics and
shouldn’t inherit behaviour from the default plot specification, e.g. borders.
expand
expand the range of values by this much (vector of length 2) when fullrange is
set to TRUE
...
other arguments passed on to layer. There are three types of arguments you
can use here:
• Aesthetics: to set an aesthetic to a fixed value, like color = "red" or
size = 3.
• Other arguments to the layer, for example you override the default stat
associated with the layer.
• Other arguments passed on to the stat.
n
number of points to evaluate smoother at
span
Controls the amount of smoothing for the default loess smoother. Smaller numbers produce wigglier lines, larger numbers produce smoother lines.
geom_Xisoprop
23
fullrange
should the fit span the full range of the plot, or just the data
level
level of confidence interval to use (0.95 by default)
method.args
List of additional arguments passed on to the modelling function defined by
method.
Examples
data(Feldspar)
ggtern(data=Feldspar,aes(Ab,An,Or,group=Feldspar)) +
geom_smooth_tern(method=lm,fullrange=TRUE,colour='red') +
geom_point() +
labs(title="Example Smoothing")
geom_Xisoprop
Fixed Value Isoproportion Lines
Description
Create fixed isoproportion lines for each of the ternary axes, geom_Xisoprop(...), (X = T, L, R)
will draw an isoproportion line projecting from the T, L and R apex respectively.
Usage
geom_Tisoprop(mapping = NULL, data = NULL, ..., value, na.rm = FALSE,
show.legend = NA)
geom_Lisoprop(mapping = NULL, data = NULL, ..., value, na.rm = FALSE,
show.legend = NA)
geom_Risoprop(mapping = NULL, data = NULL, ..., value, na.rm = FALSE,
show.legend = NA)
Arguments
mapping
Set of aesthetic mappings created by aes or aes_. If specified and inherit.aes = TRUE
(the default), is combined with the default mapping at the top level of the plot.
You only need to supply mapping if there isn’t a mapping defined for the plot.
data
A data frame. If specified, overrides the default data frame defined at the top
level of the plot.
...
other arguments passed on to layer. There are three types of arguments you
can use here:
• Aesthetics: to set an aesthetic to a fixed value, like color = "red" or
size = 3.
• Other arguments to the layer, for example you override the default stat
associated with the layer.
• Other arguments passed on to the stat.
24
geom_Xline
value,
the isoproportion ratio to draw
na.rm
If FALSE (the default), removes missing values with a warning. If TRUE silently
removes missing values.
show.legend
logical. Should this layer be included in the legends? NA, the default, includes if
any aesthetics are mapped. FALSE never includes, and TRUE always includes.
Aesthetics
geom_Tisoprop understands the following aesthetics (required aesthetics are in bold):
• value
• alpha
• arrow
• colour
• linetype
• size
Author(s)
Nicholas Hamilton
Examples
data(Feldspar)
ggtern(data=Feldspar,aes(Ab,An,Or)) +
geom_Tisoprop(value=0.5) +
geom_Lisoprop(value=0.5) +
geom_Risoprop(value=0.5) +
geom_point()
geom_Xline
Fixed Value Lines
Description
Plot fixed value lines, for the top, left and right axis, analagous to the geom_hline and geom_vline
geometries in ggplot2
Usage
geom_Tline(mapping = NULL, data = NULL, ..., Tintercept, na.rm = FALSE,
show.legend = NA)
Tline(mapping = NULL, data = NULL, ..., Tintercept, na.rm = FALSE,
show.legend = NA)
geom_Xline
25
tline(mapping = NULL, data = NULL, ..., Tintercept, na.rm = FALSE,
show.legend = NA)
geom_Lline(mapping = NULL, data = NULL, ..., Lintercept, na.rm = FALSE,
show.legend = NA)
Lline(mapping = NULL, data = NULL, ..., Lintercept, na.rm = FALSE,
show.legend = NA)
lline(mapping = NULL, data = NULL, ..., Lintercept, na.rm = FALSE,
show.legend = NA)
geom_Rline(mapping = NULL, data = NULL, ..., Rintercept, na.rm = FALSE,
show.legend = NA)
Rline(mapping = NULL, data = NULL, ..., Rintercept, na.rm = FALSE,
show.legend = NA)
rline(mapping = NULL, data = NULL, ..., Rintercept, na.rm = FALSE,
show.legend = NA)
Arguments
mapping
Set of aesthetic mappings created by aes or aes_. If specified and inherit.aes = TRUE
(the default), is combined with the default mapping at the top level of the plot.
You only need to supply mapping if there isn’t a mapping defined for the plot.
data
A data frame. If specified, overrides the default data frame defined at the top
level of the plot.
...
other arguments passed on to layer. There are three types of arguments you
can use here:
• Aesthetics: to set an aesthetic to a fixed value, like color = "red" or
size = 3.
• Other arguments to the layer, for example you override the default stat
associated with the layer.
• Other arguments passed on to the stat.
Tintercept, Lintercept, Rintercept
the intercepts for the T, L and R axis respectively
na.rm
If FALSE (the default), removes missing values with a warning. If TRUE silently
removes missing values.
show.legend
logical. Should this layer be included in the legends? NA, the default, includes if
any aesthetics are mapped. FALSE never includes, and TRUE always includes.
Author(s)
Nicholas Hamilton
26
ggsave
Examples
ggtern() +
geom_Tline(Tintercept=.5,arrow=arrow(), colour='red') +
geom_Lline(Lintercept=.2, colour='green') +
geom_Rline(Rintercept=.1, colour='blue')
ggsave
Save a ggplot (or other grid object) with sensible defaults (ggtern version)
Description
ggsave() is a convenient function for saving a plot. It defaults to saving the last plot that you
displayed, using the size of the current graphics device. It also guesses the type of graphics device
from the extension.
Usage
ggsave(filename, plot = last_plot(), device = NULL, path = NULL,
scale = 1, width = NA, height = NA, units = c("in", "cm", "mm"),
dpi = 300, limitsize = TRUE, ...)
Arguments
filename
plot
device
path
scale
width, height
units
dpi
limitsize
...
File name to create on disk.
Plot to save, defaults to last plot displayed.
Device to use (function or any of the recognized extensions, e.g. "pdf"). By
default, extracted from filename extension. ggsave currently recognises eps/ps,
tex (pictex), pdf, jpeg, tiff, png, bmp, svg and wmf (windows only).
Path to save plot to (combined with filename).
Multiplicative scaling factor.
Plot dimensions, defaults to size of current graphics device.
Units for width and height when specified explicitly (in, cm, or mm)
Resolution used for raster outputs.
When TRUE (the default), ggsave will not save images larger than 50x50 inches,
to prevent the common error of specifying dimensions in pixels.
Other arguments passed on to graphics device
Examples
## Not run:
data(Feldspar)
base = ggtern(Feldspar,aes(Ab,An,Or)) + geom_point()
ggsave("./output.pdf",base,width=10,height=10)
## End(Not run)
ggtern
ggtern
27
ggtern Constructor
Description
Plots in ggtern are instigated via the default constructor: ggtern(...), which is essentially a
convenience wrapper for the following: ggplot{...} + coord_tern(), indeed, if one wishes to
use ggplot{...} + coord_tern() then this is quite satisfactory.
Usage
ggtern(...)
Arguments
...
Other arguments passed on to methods. Not currently used.
Value
ggtern(...) returns an object of class ggplot.
See Also
For an introduction to the ggtern package, (including many examples), click HERE.
ggtern_labels
Change Axis labels and legend titles
Description
New label modification functions, equivalent to the original functions in ggplot2 (xlab and ylab)
however for the new axes used in the ggtern package
Tlab modifies the label of the TOP apex species
Llab modifies the label of the LHS apex species
Rlab modifies the label of the RHS apex species
Wlab modifies the label of the arrow suffix
28
ggtern_labels
Usage
Tlab(label, labelarrow = label)
Llab(label, labelarrow = label)
Rlab(label, labelarrow = label)
Wlab(label)
zlab(label)
Tarrowlab(label)
Larrowlab(label)
Rarrowlab(label)
Arguments
label
the desired label
labelarrow
the desired label, if different to label, for the markers along the procession arrows
Details
Tlab and xlab are equivalent (when T='x' in the coord_tern definition), as is Llab and ylab
(when L='y') , and Rlab and zlab (when R='z'), for other assignments when coord_tern is
defined, the equivalence is not the case, however, if T='XXX', then Tlab will be the same as XXXlab
(where XXX can be substituted for 'x', 'y' or 'z', and likewise for Llab and Rlab).
zlab is new to ggtern, but is intended to be an analogous to xlab and ylab as per the definitions
in ggplot2.
Arrow Label
Tarrowlab, Larrowlab and Rarrowlab permits setting a different label to the apex labels.
Arrow Label Suffix
Wlab changes the ternary arrow suffix (ie atomic percent, weight percent etc) when the ternary
arrows are enabled (see theme_showarrows and weight_percent)
Precedence
AAAlab takes precedence over BBBlab (where AAA represents T, L or R and BBB represents
x, y or z)
ggtern_package
29
Use of Expressions
Expressions can be used in the labels, in the event that the user wishes to render formula, subscripts
or superscripts, see the last example below.
Creation of Aliasses
Aliasses exist for Tlab, Llab, Rlab and Wlab, which are tlab, llab, rlab and wlab. These aliasses
produce an identical result, and are there for convenience (as opposed to having an error thrown) in
the event that the user forgets to use an upper-case letter.
Arguments for these functions can be provided as a character or expression, although other
values can be inputed (such as, for example, scalar numeric or logical). ggtern also imports the
latex2exp package, and these formats can be parsed too.
See Also
ggplot2 labs
Examples
data(Feldspar)
plot <- ggtern(data=Feldspar,aes(Ab,An,Or)) + geom_point() +
xlab("ABC") + ylab("DEF") + zlab("GHI")
#Alternatives, and Arrow Label
plot + Tlab("TOP") + Llab("LHS") + Rlab("RHS") +
Tarrowlab("Top Arrow Label") + Larrowlab("Left Arrow Label") + Rarrowlab("Right Arrow Label") +
theme_showarrows() + Wlab("WEIGHT")
#Demonstrate the use of the latex2exp integration, and seperate arrow labels.
ggtern(data=Feldspar,aes(x=Ab,y=An,z=Or)) +
labs( x
= "NaAlSi_3O_8",
xarrow = "Albite, NaAlSi_3O_8",
y
= "(Na,K)AlSi_3O_8",
yarrow = "Anorthite (Na,K)AlSi_3O_8",
z
= "KAlSi_3O_8",
zarrow = "Orthoclase KAlSi_3O_8") +
geom_point() + theme_showarrows() + theme_clockwise() + weight_percent()
ggtern_package
Ternary Diagrams in R
Description
Ternary diagrams are used frequently in a number of disciplines to graph compositional features for
mixtures of three different elements or compounds. It is possible to represent a coordinate system
having three (3) degrees of freedom, in 2D space, since the third dimention is linear and depends
only on the other two.
30
ggtern_package
The ggtern package is based on (extends) the very popular ggplot2 package, which is an implementation of Wilkinsons "The Grammar of Graphics", and, makes provision for a highly methodical
construction process for the development of meaningful (graphical) data representations. Of course,
the above book by Wilkinson outlines the theory, whilst Hadley Wickhams ggplot2 implementation is where much of the magic happens, and, an ideal base-platform for the ggtern package.
In this document, some of the main features are highlighted, however, current examples (and corresponding outputs) can be viewed at http://ggtern.com
ggtern Constructor
Plots in ggtern are instigated via the default constructor: ggtern(...), for additional information,
click HERE:
ggtern Ternary Coordinate System
The foundation of this package, is the ternary coordinate system, which can be produced with the
coord_tern(...) command and added to an existing ggplot object. The ggtern(...) constructor adds the coord_tern(...) coordinate system by default. For further information on the
coord_tern(...) coordinate system, click HERE.
ggtern Valid Geometries
ggplot2, using the grid and proto architectures, makes provision for a many number of geometries
to be added progressively in ’layers’ to a given base plot. Due to the nature of the ternary coordinate
system, some of the geometries which are available in ggplot2, are not relevant (or won’t function)
with ternary plots and as such, a limited number of ’approved’ geometries can be used. Click HERE
for the full list of approved geometries.
Notably, ggtern includes novel geometries not available to ggplot2 which include:
1. Confidence Intervals via the Mahalnobis Distance
2. Ternary Errorbars
3. Ternary Constant-Lines
ggtern Handling Non-Approved Geometries
If a geometric layer is added that is NOT contained in the approved list, IT WILL BE STRIPPED
/ IGNORED from the ternary diagram when rendering takes place (notifying the user to such
effect). The reason for this is that subtle ’patches’ have been applied, which are mainly to do with
the transformation procedures when incorporating a ’third’ dimention. NB: In the future, others
may be made available once patched.
ggtern New Theme Elements and Heirarchies
ggtern implements many new theme elements and heirarchies which can be tailored on a case-bycase basis. The full list of new elements can is provided HERE.
ggtern Theme Element Convenience Functions
ggtern has made available a number of convenience functions, for rapid tweaking of common
theme elements, for a comprehensive list, see HERE.
ggtern_themes
31
ggtern Modification to Required Aesthetics
Each geometry has a pre-determined set of required aesthetics. These have been modifid such that
where x and y were previously required, now an additional z aesthetic is required (geom_segment
now requires z and zend). This is made possible without affecting the standard ggplot2 behaviour
because ggtern distinuishes between ggplot2 and ggtern objects, distinguished by the presence
of the coord_tern(...) coordinate system.
ggtern Provided Datasets
ggtern ships with a number of datasets, including:
1. Elkin and Groves Feldspar Data
2. USDA Textural Classification Data
3. Grantham and Valbel Rock Fragment Data
Author(s)
Nicholas Hamilton
Examples
##----------------------------------------------## Basic Usage
##----------------------------------------------df = data.frame(x = runif(50),
y = runif(50),
z = runif(50),
Value = runif(50,1,10),
Group = as.factor(round(runif(50,1,2))))
ggtern(data=df,aes(x,y,z,color=Group)) +
theme_rgbw() +
geom_point() + geom_path() +
labs(x="X",y="Y",z="Z",title="Title")
ggtern_themes
ggtern themes
Description
Themes set the general aspect of the plot such as the colour of the background, gridlines, the size
and colour of fonts.
theme_rgbg is a theme with grey background, red, green and blue axes and gridlines
32
ggtern_themes
Usage
theme_gray(base_size = 12, base_family = "")
theme_bw(base_size = 12, base_family = "")
theme_linedraw(base_size = 12, base_family = "")
theme_classic(base_size = 12, base_family = "")
theme_void(base_size = 12, base_family = "")
theme_rgbg(base_size = 12, base_family = "")
theme_rgbw(base_size = 12, base_family = "")
theme_minimal(base_size = 12, base_family = "")
theme_dark(base_size = 12, base_family = "")
theme_darker(base_size = 12, base_family = "")
theme_light(base_size = 12, base_family = "")
theme_custom(base_size = 12, base_family = "",
tern.plot.background = "gray92", col.T = "gray95", col.L = "gray95",
col.R = "gray95", col.BG = "transparent", col.grid.minor = "gray90")
Arguments
base_size
base font size
base_family
base font family
tern.plot.background
colour of background colour to plot area
col.T
colour of top axis, ticks labels and major gridlines
col.L
colour of left axis, ticks, labels and major gridlines
col.R
colour of right axis, ticks, labels and major gridlines
col.BG
colour of the plot background area
col.grid.minor the colour of the minor grid theme_custom is a convenience function to allow
the user to control the basic theme colours very easily.
Details
theme_gray The signature ggplot2 theme with a grey background and white gridlines, designed to
put the data forward yet make comparisons easy.
theme_bw The classic dark-on-light ggplot2 theme. May work better for presentations displayed
with a projector.
label_formatter
33
theme_linedraw A theme with only black lines of various widths on white backgrounds, reminiscent of a line drawings. Serves a purpose similar to theme_bw. Note that this theme has some
very thin lines (« 1 pt) which some journals may refuse.
theme_light A theme similar to theme_linedraw but with light grey lines and axes, to direct
more attention towards the data.
theme_dark The dark cousin of theme_light, with similar line sizes but a dark background. Useful to make thin coloured lines pop out.
theme_darker A darker cousing to theme_dark, with a dark panel background.
theme_minimal A minimalistic theme with no background annotations.
theme_classic A classic-looking theme, with x and y axis lines and no gridlines.
theme_rgbw A theme with white background, red, green and blue axes and gridlines
theme_rgbg A theme with grey background, red, green and blue axes and gridlines
theme_void A completely empty theme.
theme_custom Theme with custom basic colours
Examples
data(Feldspar)
p <- ggtern(Feldspar,aes(Ab,An,Or)) +
geom_point(aes(colour=T.C,size=P.Gpa)) +
facet_wrap(~Feldspar)
#Uncomment to run
p + theme_gray()
p + theme_rgbg()
p + theme_dark()
label_formatter
label_formatter is a function that formats / parses labels for use in
the grid.
Description
label_formatter is a function that formats / parses labels for use in the grid.
Usage
label_formatter(label)
Arguments
label
character label
34
position_jitter_tern
mahalanobis_distance
Mahalanobis Distance
Description
Modified version of the code provided in the drawMahal package
Usage
mahalanobis_distance(x, x.mean, x.cov, whichlines = c(0.975, 0.9, 0.75),
m = 360)
Arguments
x
x.mean
x.cov
whichlines
m
data
mean value
coveriance value
the confidence values
the number of values to return for each line
Value
list containing mdX and mdY values.
Author(s)
Nicholas Hamilton
position_jitter_tern
Jitter ternary points to avoid overplotting.
Description
Jitter ternary points to avoid overplotting.
Usage
position_jitter_tern(x = NULL, y = NULL, z = NULL)
Arguments
x, y, z
amount of positional jitter
See Also
Other position.adjustments: position_nudge_tern
position_nudge_tern
35
position_nudge_tern
Nudge Ternary Points.
Description
This is useful if you want to nudge labels a little ways from their points, input data will normalised
to sum to unity before applying the particular nudge, so the nudge variables should be as a fraction
ie (0,1)
Usage
position_nudge_tern(x = 0, y = 0, z = 0)
Arguments
x, y, z
Amount of compositions to nudge
See Also
Other position.adjustments: position_jitter_tern
scale_T_continuous
Continuous position scales (T, L & R).
Description
Continuous position scales (T, L & R).
Usage
scale_T_continuous(name = waiver(), limits = c(0, 1),
breaks = getBreaks(limits, TRUE), minor_breaks = getBreaks(limits, FALSE),
labels = 100 * breaks, expand = waiver(), ...)
scale_L_continuous(name = waiver(), limits = c(0, 1),
breaks = getBreaks(limits, TRUE), minor_breaks = getBreaks(limits, FALSE),
labels = 100 * breaks, expand = waiver(), ...)
scale_R_continuous(name = waiver(), limits = c(0, 1),
breaks = getBreaks(limits, TRUE), minor_breaks = getBreaks(limits, FALSE),
labels = 100 * breaks, expand = waiver(), ...)
36
stat_density_tern
Arguments
name
The name of the scale. Used as axis or legend title. If NULL, the default, the
name of the scale is taken from the first mapping used for that aesthetic.
limits
A numeric vector of length two providing limits of the scale. Use NA to refer to
the existing minimum or maximum.
breaks
One of:
•
•
•
•
minor_breaks
NULL for no breaks
waiver() for the default breaks computed by the transformation object
A numeric vector of positions
A function that takes the limits as input and returns breaks as output
One of:
• NULL for no minor breaks
• waiver() for the default breaks (one minor break between each major
break)
• A numeric vector of positions
• A function that given the limits returns a vector of minor breaks.
labels
One of:
•
•
•
•
NULL for no labels
waiver() for the default labels computed by the transformation object
A character vector giving labels (must be same length as breaks)
A function that takes the breaks as input and returns labels as output
expand
A numeric vector of length two giving multiplicative and additive expansion
constants. These constants ensure that the data is placed some distance away
from the axes. The defaults are c(0.05, 0) for continuous variables, and
c(0, 0.6) for discrete variables.
...
not used
stat_density_tern
Density Estimate
Description
Perform a 2D kernel density estimatation using kde2d and display the results with contours. This
can be useful for dealing with overplotting. Additional weight aesthetic (see aesthetic section below) permits better weighting if desired
Usage
stat_density_tern(mapping = NULL, data = NULL, geom = "density_tern",
position = "identity", contour = TRUE, n = 100, h = NULL,
na.rm = FALSE, show.legend = NA, inherit.aes = TRUE, weight = 1,
base = "ilr", expand = c(0.5, 0.5), ...)
stat_density_tern
37
Arguments
mapping
Set of aesthetic mappings created by aes or aes_. If specified and inherit.aes = TRUE
(the default), is combined with the default mapping at the top level of the plot.
You only need to supply mapping if there isn’t a mapping defined for the plot.
data
A data frame. If specified, overrides the default data frame defined at the top
level of the plot.
geom
Use to override the default connection between geom_density_2d and stat_density_2d.
position
Position adjustment, either as a string, or the result of a call to a position adjustment function.
contour
If TRUE, contour the results of the 2d density estimation
n
number of grid points in each direction
h
Bandwidth (vector of length two) as a multiple of the best estimate, estimated
using bandwidth.nrd.
na.rm
If FALSE (the default), removes missing values with a warning. If TRUE silently
removes missing values.
show.legend
logical. Should this layer be included in the legends? NA, the default, includes if
any aesthetics are mapped. FALSE never includes, and TRUE always includes.
inherit.aes
If FALSE, overrides the default aesthetics, rather than combining with them.
This is most useful for helper functions that define both data and aesthetics and
shouldn’t inherit behaviour from the default plot specification, e.g. borders.
weight
weighting for weighted kde2d esimate, default’s to 1, which is non-weighted
and equivalent to the usual kde2d calculation
base
the base transformation of the data, options include ’identity’ (ie direct on the
cartesian space), or ’ilr’ which means to use the isometric log ratio transformation.
expand
Calculate on a mesh which extends beyond the grid of the plot region by this
amount If NULL, estimated using bandwidth.nrd.
...
other arguments passed on to layer. There are three types of arguments you
can use here:
• Aesthetics: to set an aesthetic to a fixed value, like color = "red" or
size = 3.
• Other arguments to the layer, for example you override the default stat
associated with the layer.
• Other arguments passed on to the stat.
Aesthetics
stat_density_tern understands the following aesthetics (required aesthetics are in bold):
• x
• y
• z
38
suffix_arrow
Examples
#Plot Density Estimate, on isometric log ratio transformation of original data
data(Feldspar)
ggtern(Feldspar,aes(Ab,An,Or)) +
stat_density_tern(aes(fill=..level..),geom='polygon',base='ilr')
suffix_arrow
Atomic, Weight or Custom Percentage Suffix
Description
By default there are no suffixes behind the arrow label marker (the arrow up next to the ternary
axes), and these functions appends to the set of arrow labels, a value to indicate the nature of the
scale.
percent_weight adds ’Wt. %’ to the arrow marker label as a suffix
weight_percent is an alias for percent_weight()
percent_atomic adds ’At. %’ to the arrow marker label as a suffix
atomic_percent is an alias for percent_atomic()
percent_custom adds a custom suffix to the arrow label marker.
custom_percent is an alias for percent_custom()
Usage
percent_weight()
weight_percent()
percent_atomic()
atomic_percent()
percent_custom(x)
custom_percent(x)
Arguments
x
the custom suffix
Details
These are convenience wrappers to labs(W="XYZ").
See Also
Convenience functions for T, L, R, W labels
ternary-transformation
39
ternary-transformation
Ternary / Cartesian Transformation
Description
Functions to transform data from the ternary to cartesian spaces and vice-versa.
Usage
tlr2xy(data, coord, ..., inverse = FALSE, scale = TRUE, drop = FALSE)
xy2tlr(data, coord, ..., inverse = FALSE, scale = TRUE)
Arguments
data
coord
...
inverse
scale
drop
data.frame containing columns as required by the coordinate system. Data will
be scaled so that the rows sum to unity, in the event that the user has provided
data that does not.
Coordinate system object, inheriting the CoordTern class, error will be thrown
if a different coordinate system is sent to this method
not used
logical if we are doing a forward (FALSE) or reverse (TRUE) transformation
logical as to whether the transformed coordinates are scaled (or reverse scaled
in the case of inverse transformation) according to the training routine defined
in the coordinate system.
drop all non columns which are not involved in the transformation
Details
tlr2xy transforms from the ternary to cartesian spaces, an inverse transformation transforms between cartesian to ternary spaces
xy2tlr transforms from the cartesian to ternary spaces, an inverse transformation transforms between ternary to cartesian spaces, it is the reciprocal to tlr2xy, therefore an inverse transformation
in xy2tlr function is the same as the forward transformation in tlr2xy
Author(s)
Nicholas Hamilton
Examples
data(Feldspar)
dfm = plyr::rename(Feldspar,c("Ab"="x","An"="y","Or"="z"))
crd = coord_tern()
fwd = tlr2xy(dfm,crd)
rev = tlr2xy(fwd,crd,inverse = TRUE)
40
tern_limits
tern_limits
Restrict Ternary Limits
Description
tern_limits (or its aliasses) appends new T, L and R ternary continuous scales, where the maximum scale value is specified, and, where the minimums for each are solved.
Usage
tern_limits(T = 1, L = 1, R = 1, ...)
limits_tern(...)
limit_tern(...)
tern_limit(...)
Arguments
T, L, R
numeric value (scalar) of the maximum T,L,R species limit for each scale respectively
...
other arguments to pass to ALL of scale_X_continuous (X = T, L, R)
Details
The contra value (ie minimum value) for the T, L and R species is solved using linear equations,
therefore, if the solution is degenerate, or, the solution results in a zero range in either of the
proposed scales, then a warning message will be reported and an empty list returned. Note that
limits_tern(...), limit_tern(...) and tern_limit(...) are all aliasses for the main function, tern_limits(...) and can be used interchangeably.
Value
Either an empty list (when no solution can be found), or a list containing one of each of scale_X_continuous
(X = T, L, R)
Author(s)
Nicholas Hamilton
See Also
scale_T_continuous, scale_L_continuous and scale_R_continuous
theme
41
Examples
df = data.frame(x=runif(10),y=runif(10),z=runif(10))
ggtern(df,aes(x,y,z)) + geom_point() + tern_limits(0.7,0.3,0.4)
theme
New Theme Elements
Description
ggtern creates many new theme elements and inheritances, the following is an outline:
Usage
theme(..., complete = FALSE)
Arguments
...
a list of element name, element pairings that modify the existing theme.
complete
set this to TRUE if this is a complete theme, such as the one returned by theme_grey().
Complete themes behave differently when added to a ggplot object.
Details
Theme elements can inherit properties from other theme elements. For example, axis.title.x
inherits from axis.title, which in turn inherits from text. All text elements inherit directly or
indirectly from text; all lines inherit from line, and all rectangular objects inherit from rect.
Modifying the newly created items requires the same procedures as introduced in the ggplot2
theme documentation. Some convenience functions have been also newly created, proceed to
convenience for additional information.
New/Additional Inheritance Structures
Based on the ggplot2 existing structure (theme), the NEW individual theme elements for the
ternary plot are as follows:
NAME
tern.panel.background
tern.plot.background
tern.axis
tern.axis.hshift
tern.axis.vshift
tern.axis.clockwise
tern.axis.line
tern.axis.line.T
tern.axis.line.L
tern.axis.line.R
tern.axis.title
OBJECT/(INHERITS)
element_rect/(panel.background)
element_rect/(plot.background)
element_line/(line)
unit
unit
logical
element_line/(tern.axis)
element_line/(tern.axis.line)
element_line/(tern.axis.line)
element_line/(tern.axis.line)
element_text/(tern.axis.text)
DESCRIPTION
Background of Ternary Clipping Area**
Background of Ternary Plot Area**
Base line for ggtern object
Amount to nudge the plot horizontally
Amount to nudge the plot vertically
Clockwise or Anticlockwise Precession
Base Line
Line for TOP Axis
Line for LHS Axis
LIne for RHS Axis
Base Apex Title
42
tern.axis.title.T
tern.axis.title.L
tern.axis.title.R
tern.axis.title.show
tern.axis.text
tern.axis.text.T
tern.axis.text.L
tern.axis.text.R
tern.axis.text.show
tern.axis.arrow
tern.axis.arrow.T
tern.axis.arrow.L
tern.axis.arrow.R
tern.axis.arrow.text
tern.axis.arrow.text.T
tern.axis.arrow.text.L
tern.axis.arrow.text.R
tern.axis.arrow.show
tern.axis.arrow.sep
tern.axis.arrow.start
tern.axis.arrow.finish
tern.axis.ticks
tern.axis.ticks.major
tern.axis.ticks.major.T
tern.axis.ticks.major.L
tern.axis.ticks.major.R
tern.axis.ticks.length.major
tern.axis.ticks.length.minor
tern.axis.ticks.outside
tern.axis.ticks.primary.show
tern.axis.ticks.secondary.show
tern.axis.ticks.minor
tern.axis.ticks.minor.T
tern.axis.ticks.minor.L
tern.axis.ticks.minor.R
tern.panel.grid
tern.panel.grid.major
tern.panel.grid.major.T
tern.panel.grid.major.L
tern.panel.grid.major.R
tern.panel.grid.major.show
tern.panel.grid.minor
tern.panel.grid.minor.T
tern.panel.grid.minor.L
tern.panel.grid.minor.R
tern.panel.grid.minor.show
tern.panel.grid.ontop
tern.panel.expand
theme
element_text/(tern.axis.title)
element_text/(tern.axis.title)
element_text/(tern.axis.title)
logical
element_text/(text)
element_text/(tern.axis.text)
element_text/(tern.axis.text)
element_text/(tern.axis.text)
logical
element_line/(tern.axis)
element_line/(tern.axis.arrow)
element_line/(tern.axis.arrow)
element_line/(tern.axis.arrow)
element_text/(tern.axis.text)
element_text/(tern.axis.arrow.text)
element_text/(tern.axis.arrow.text)
element_text/(tern.axis.arrow.text)
logical
numeric
numeric
numeric
element_line/(tern.axis)
element_line/(tern.axis.ticks)
element_line/(tern.axis.ticks.major)
element_line/(tern.axis.ticks.major)
element_line/(tern.axis.ticks.major)
unit
unit
logical
logical
logical
element_line/(tern.axis.ticks)
element_line/(tern.axis.ticks.minor)
element_line/(tern.axis.ticks.minor)
element_line/(tern.axis.ticks.minor)
element_line/(tern.axis)
element_line/(tern.panel.grid)
element_line/(tern.panel.grid.major)
element_line/(tern.panel.grid.major)
element_line/(tern.panel.grid.major)
logical
element_line/(tern.panel.grid)
element_line/(tern.panel.grid.minor)
element_line/(tern.panel.grid.minor)
element_line/(tern.panel.grid.minor)
logical
logical
numeric
Apex Title for TOP Axis
Apex Title for LHS Axis
Apex Title for RHS Axis
Apex Titles Show or Hide
Base Text
Text for TOP Axis
Text for LHS Axis
Text for RHS Axis
Axis Labels Show or Hide
Base Arrow Line
Arrow Line for TOP Axis
Arrow Line for LHS Axis
Arrow Line for RHS Axis
Base Arrow Label
Arrow Label on TOP Axis
Arrow Label on LHS Axis
Arrow Label on RHS Axis
Arrows Show or Hide
Arrows Seperation from Axis
Proportion of Axis when Arrow Starts
Proportion of Axis when Arrow Finishes
Base Ticks
Base Major Ticks
Base Major Ticks for TOP Axis
Base Major Ticks for LHS Axis
Base Major Ticks for RHS Axis
Ticks Major Ticklength
Ticks Minor Ticklength
Ticks Outside or Inside
Ticks Show Primary
Ticks Show Secondary
Base Minor Ticks
Base Minor Ticks for TOP Axis
Base Minor Ticks for LHS Axis
Base Minor Ticks for RHS Axis
Base Gridline
Base Major Gridline
Major Gridline for TOP Axis
Major Gridline for LHS Axis
Major Gridline for RHS Axis
Show or Hide Major Gridline
Base Minor Gridline
Minor Gridline for TOP Axis
Minor Gridline for LHS Axis
Minor Gridline for RHS Axis
Show or Hide Minor Gridline
The amount to expand the ternary plotting pa
The amount to expand the ternary plotting pa
themearrowlength
43
tern.panel.rotate
numeric
The amount to rotate the ternary diagram in
** NB: tern.panel.background, whilst the ternary area is ’triangular’ per-se, element_rect has
been used, as it actually holds NO information regarding the geometry (width, height), only fill,
color, size and linetype border (ie the style of how it will be rendered).
themearrowlength
Change the Length of the Ternary Arrows
Description
A set of convenience functions to rapidly change the length of the ternary arrows, the convenience
functions include presets (short, normal, long), or makes provision for the user to specify custom
fractional starting and ending values relative to the size of the ternary axis. In the event that the
user elects to specify the values via the theme_arrowcustomlength (or its aliasses), then the user
can specify a single scalar value which apply to all three (3) arrows, or, alternatively, can provide a
numeric vector of length three (3), one for each arrow respectively.
Usage
theme_arrowcustomlength(start = getOption("tern.arrow.start"),
finish = getOption("tern.arrow.finish"))
theme_arrowlength(start = getOption("tern.arrow.start"),
finish = getOption("tern.arrow.finish"))
theme_arrowsmall()
theme_arrowshort()
theme_arrownormal()
theme_arrowdefault()
theme_arrowlarge()
theme_arrowlong()
Arguments
start
a numeric scalar, or numeric vector of length three (3), representing the fractional [0,1] position along the axis where the arrow/s should START.
finish
a numeric scalar, or numeric vector of length three (3), representing the fractional [0,1] position along the axis where the arrow/s should FINISH.
44
themearrowlength
Details
If the ternary arrows are switched OFF (via the theme_hidearrows command, or the theme(tern.axis.arrow.show=FALSE)
theme element), then under such circumstance, these convenience functions will turn ON the ternary
arrows, essentially running theme_showarrows or theme(tern.axis.arrow.show=TRUE)
If for some reason, the start and finish arguments are identical, then the ternary arrows will be
switched OFF, tantamount to running the theme_hidearrows convenience function.
Custom Length
theme_arrowcustomlength or theme_arrowlength (alias) sets the ternary arrow lengths to values
as specified by the user, occupying a length between the values as specified by the start and finish
arguments (fractions) relative to the length of the ternary axis.
Short Arrow Length
theme_arrowsmall or theme_arrowshort(alias) reduces the ternary arrows to short arrows, occupying a length between 0.4 and 0.6 of the length of the ternary axis
Normal/Default Arrow Length
theme_arrownormal or theme_arrowdefault(alias) reduces the ternary arrows to normally sized
arrows, occupying a length between getOption("tern.arrow.start") and getOption("tern.arrow.finish")
global option values, whatever they may be.
Long Arrow Length
theme_arrowlarge or theme_arrowlong(alias) increases the ternary arrows to long arrows occupying a length between 0.2 and 0.8 of the length of the ternary axis
See Also
theme_arrowbaseline and theme(tern.axis.arrow.sep=X) for methods to adjust the separation
distance of the ternary arrows from the ternary axes.
Examples
#Create base plot
#plot <- ggtern(data=data.frame(x=1,y=1,z=1),aes(x,y,z)) + geom_point()
#Pre-Specified Values
plot + theme_arrowsmall()
## Alternatives, Uncomment lines below
#plot + theme_arrownormal()
#plot + theme_arrowlarge()
#plot + theme_arrowcustomlength(.1,.8)
#plot + theme_arrowlength(start=c(.1,.2,.3),finish=c(.9,.8,.7))
theme_clockwise
theme_clockwise
45
Direction of Ternary Rotation
Description
theme_clockwise, theme_anticlockwise (or their aliasses) are function that instructs the axes
precession to be clockwise or anticlockwise respectively.
Usage
theme_clockwise()
theme_anticlockwise()
theme_counterclockwise()
tern_clockwise()
tern_anticlockwise()
tern_counterclockwise()
Details
If the tern.axis.arrow.show value is FALSE, these functions will set it to TRUE.
theme_complete
Complete Themes
Description
ggtern ships with a number of complete themes:
• Black and White Theme: theme_bw(...)
• Minimal Theme: theme_minimal(...)
• Classic Theme: theme_classic(...)
• Gray and White Theme: theme_gray(...)
• Red, Green, Blue and White Theme: theme_rgbw(...)
• Red, Green, Blue and Gray Theme: theme_rgbg(...)
• Dark Theme: theme_dark(...)
• Darker Theme: theme_darker(...)
• Light Theme: theme_light(...)
• Theme with Only Black Lines: theme_linedraw(...)
46
theme_legend_position
Author(s)
Nicholas Hamilton
theme_gridsontop
Render Grids on Top
Description
Convenience function to render the major and minor grids on top of the other layers.
Usage
theme_gridsontop()
Author(s)
Nicholas Hamilton
theme_legend_position Position Legend in Convenient Locations
Description
A convenience function to position the legend at various internal positions
Usage
theme_legend_position(x = "topleft")
Arguments
x
Author(s)
Nicholas Hamilton
the position, valid values are topleft, middleleft, bottomleft, topright, middleright
and bottomright, or the shortened versions respecitvely, tl, ml, bl, tr, mr, br
theme_noarrows
47
theme_noarrows
Show or Hide the Ternary Arrows
Description
theme_noarrows is a function that appends to the current theme a flag to switch OFF the ternary
arrows
theme_hidearrows is an alias for theme_noarrows
theme_showarrows is a function that appends to the current theme a flag to switch ON the ternary
arrows
Usage
theme_noarrows()
theme_hidearrows()
theme_showarrows()
theme_novar_tern
Blank one variable’s annotations in ternary plot
Description
This function blanks the grid and axis elements for one variable in a ternary plot.
Usage
theme_novar_tern(species, ...)
Arguments
species
...
A character giving the species. Choices are "T", "L" and "R", but is not case
sensitive
Further arguments, including additional selections otherwise used in species
Details
This function takes a user-specified character corresponding to one of the three ternary variables,
and constructs a theme function which adds blank elements for that variable’s grid elements and
axis elements chosen from the ggtern package. This new function is then executed which "adds"
this theme to the open ternary plot.
The logic of the species selection is pretty transparent so it may be possible to customize this
function to add further affected elements as desired. However the computing on the language which
drives this function has not been thoroughly tested. Neither has this function been tested with nonternary plots available in the ggplot2 framework.
48
theme_rotate
Value
This function is called for the side effect of adding a theme which actually blanks the grid and axis
elements for the chosen ternary species.
Author(s)
Nicholas Hamilton, John Szumiloski
Examples
## Not run:
theme_novar_tern("L")
theme_novar_tern(c("T","L"))
theme_novar_tern(T,L)
## End(Not run)
theme_rotate
Rotate Ternary Diagram
Description
Convenience function to rotate the diagram by an angle in degrees or radians.
Usage
theme_rotate(degrees = 60, radians = degrees * pi/180)
Arguments
degrees, radians
specify the angle to rotate the plot by in either degrees or radians. If both
degrees and radians are specified, then precedence is given to the radians
argument. If no value is specified, the plot will rotate by 60 degrees
Author(s)
Nicholas Hamilton
Examples
x = ggtern(data.frame(x=1,y=1,z=1),aes(x,y,z))
for(a in seq(0,60,by=15))
print(x + theme_rotate(a))
theme_showgrid
theme_showgrid
49
Show or Hide Grid
Description
A set of convenience functions to enable or disable the use of major or minor (or both) gridlines.
Usage
theme_showgrid()
theme_hidegrid()
theme_nogrid()
theme_tern_nogrid()
theme_showgrid_major()
theme_hidegrid_major()
theme_nogrid_major()
theme_tern_nogrid_major()
theme_showgrid_minor()
theme_hidegrid_minor()
Details
These flags operate at the ’rendering’ level, and, supercede the presence of theme elements, therefore,
theme_hidegrid(...) or its aliases will PREVENT rendering of grid elements, irrespective of
whether those grid elements are valid (renderable). From the counter perspective,
theme_showgrid(...) or its aliases will ALLOW rendering of grid elements, subject to those grid
elements being valid (renderable, ie say element_line as opposed to element_blank).
theme_hidegrid or theme_nogrid (alias) is a function which disables both MAJOR and MINOR
gridlines.
theme_showgrid_major is a function which enables MAJOR gridlines.
theme_hidegrid_major or theme_nogrid_major (alias) is a function which disables MAJOR
gridlines.
theme_showgrid_major is a function which enables MINOR gridlines.
theme_hidegrid_minor or theme_nogrid_minor (alias) is a function which disables MINOR
gridlines.
50
theme_showprimary
theme_showgrid is a function which enables both MAJOR and MINOR gridlines.
Examples
#Load data
data(Feldspar)
plot <- ggtern(data=Feldspar,aes(Ab,An,Or)) +
geom_point()
+ #Layer
theme_bw()
#For clarity
plot
plot = plot + theme_hidegrid(); plot
plot + theme_showgrid()
theme_showlabels
Show or Hide Axis Ticklabels
Description
Convenience functions to enable or disable the axis ticklabels
Usage
theme_showlabels()
theme_hidelabels()
theme_nolabels()
Details
theme_showlabels is a function that apends to the current theme a flag to switch ON the axis
ticklabels, whilst theme_hidelabels or theme_nolabels (Alias) are functions that apends to the
current theme a flag to switch OFF the axis ticklabels
theme_showprimary
Show or Hide the Primary/Secondary Ticks
Description
Convenience functions to enable or disable the axis primary or secondary ticks.
theme_showprimary
51
Usage
theme_noprimary()
theme_hideprimary()
theme_showprimary()
theme_nosecondary()
theme_hidesecondary()
theme_showsecondary()
theme_showticks()
theme_hideticks()
theme_noticks()
Details
In ggtern, the primary ticks are deemed as being the ticks along the binary axis increasing to the
apex species, primary ticks can consist of both major and minor ticks (major ticks have labels, and
are generally longer and bolder). Therefore, there are three (3) sets of major primary ticks, and,
three (3) sets of minor primary ticks.
These convenience functions introduce the concept of secondary ticks, which, are the same items
however on the ’opposing’ binary axis.
For example, considering the TOP apex species, in a plot with ’clockwise’ axis precession, the
primary ticks would run along the LHS, whilst, the secondary ticks, woudl run along the RHS.
By default, the primary ticks are switched ON, whilst the secondary ticks are switched OFF and
are controlled by the tern.axis.ticks.primary.show and tern.axis.ticks.secondary.show
theme elements respectively.
theme_showsecondary is a function that apends to the current theme a flag to switch ON the secondary ticks theme_showticks(), themehideticks(), theme_noticks() are functions that
switch ON or OFF BOTH the primary or secondary ticks. theme_nosecondary or theme_hidesecondary
(Alias) are functions that apends to the current theme a flag to switch OFF the secondary ticks
theme_showprimary is a function that apends to the current theme a flag to switch ON the primary
ticks theme_noprimary or theme_hideprimary (Alias) are functions that apends to the current
theme a flag to switch OFF the primary ticks
Examples
data(Feldspar)
plot <- ggtern(data=Feldspar,aes(Ab,An,Or)) + geom_point() +
theme_showsecondary()
52
theme_ticksoutside
theme_showtitles
Show or Hide the Axis (Apex) Titles
Description
Convenience functions to SHOW or HIDE the apex labels.
theme_showtitles is a function that apends to the current theme a flag to switch ON the apex
titles.
theme_hidetitles or theme_notitles (alias) is a function that apends to the current theme a flag
to switch OFF the apex titles.
Usage
theme_showtitles()
theme_hidetitles()
theme_notitles()
Examples
#Load data
data(Feldspar)
ggtern(data=Feldspar,aes(An,Ab,Or)) + geom_point() + theme_bw() + theme_hidetitles()
theme_ticksoutside
Place Ticks Inside or Outside
Description
theme_ticksoutside is a function that ensures the ticks are placed OUTSIDE of the plot area,
whereas, theme_ticksinside is a function that ensures the ticks are placed INSIDE of the plot
area (opposite to theme_ticksoutside)
Usage
theme_ticksoutside()
theme_ticksinside()
zzz-depreciated
zzz-depreciated
53
Depreciated Functions
Description
The following is a list of functions which were once used in previous versions of ggtern, however,
have now been depreciated
DEPRECIATED: tern_stop(...) Internal Function, checks if the most recent coordinate system
is ternary, and, if not, stops the current procedure, with a common message format
DEPRECIATED: clipPolygons(...) Using the using the PolyClip Package, This clips input
polygons for use in the density and contour geometries.
DEPRECIATED: theme_arrowbaseline(...) The ternary arrows can have an offset unit value
(see tern.axis.arrow.sep), however, it is convenient to set this relative to either the axis, ticks or
axis ticklabels (since the latter two can be hidden / removed.). This function permits this to be set
DEPRECIATED: element_ternary(...) Replaced by individual theme elements:
1. tern.axis.arrow.show
2. tern.axis.padding
3. tern.axis.arrow.sep
4. tern.axis.arrow.start
5. tern.axis.arrow.finish
6. tern.axis.vshift
7. tern.axis.hshift
8. tern.axis.ticks.length.major
9. tern.axis.ticks.length.minor
DEPRECIATED: ggtern.multi is a function which permits the arrangement of muliple ggtern
or ggplot2 objects, plots can be provided to the elipsis argument, or, as a list and at the simplest
case, the number of columns can be specified. For more advanced usage, consider the layout argument.
DEPRECIATED: The point.in.sequence function takes numeric input vectors x and y or a
data.frame object, and orders the values in such way that they are correctly sequenced by the
angle subtended between each point, and, the centroid of the total set. If the data is provided in
the format of a data.frame, then it must containing columns named x and y, else an error will be
thrown.
Usage
tern_stop(src = "target")
clipPolygons(df, coord, plyon = c("level", "piece", "group"),
op = "intersection")
54
zzz-depreciated
theme_arrowbaseline(label = "labels")
element_ternary(showarrows, padding, arrowsep, arrowstart, arrowfinish, vshift,
hshift, ticklength.major, ticklength.minor)
ggtern.multi(..., plotlist = NULL, cols = 1, layout = NULL)
point.in.sequence(x, y, ..., df = data.frame(x = x, y = y), close = FALSE)
Arguments
src
df
coord
plyon
op
label
character name of current procedure
a data frame
a ternary coordinate system
items in the data frame to pass to ddply argument
operation method to clip, intersection, union, minus or xor
a character (’axis’,’ticks’ or ’labels’) or numeric (rounded to 0, 1 or 2) value to
determine the relative location (labels is default) if a character is provided, and
it is not one of the above, an error will be thrown.
showarrows
logical whether to show the axis directional arrows DEPRECIATED
padding
the padding around the plot area to make provision for axis labels, ticks and
arrows, relative to the cartesian plane. DEPRECIATED
arrowsep
the distance between ternary axis and ternary arrows DEPRECIATED
arrowstart
the proportion along the ternary axis to start the directional arrow DEPRECIATED
arrowfinish
the proportion along the ternary axis to stop the directional arrow DEPRECIATED
vshift
shift the plot area vertically DEPRECIATED
hshift
shift the plot area horizontally DEPRECIATED
ticklength.major
the length of the major ternary ticks as an euclidean distance relative to the x
and y limits of the cartesian plot area. DEPRECIATED
ticklength.minor
the length of the minor ternary ticks as an euclidean distance relative to the x
and y limits of the cartesian plot area. DEPRECIATED
...
additional arguments, multiple plot objects
plotlist
alternative to the ... argument, provide a list of ggplot or grob objects, objects
which do not inherit the ggplot or grob classes will be stripped.
cols
number of columns if the layout parameter is not provided.
layout
override number of cols, and provide a matrix specifying the layout
x
vector of numeric x values
y
vector of numeric y values
close
logical value (default FALSE), as to whether the set should be closed by adding
(duplicating) the first row (after ordering) to the end of the set.
zzz-depreciated
55
Details
Used to define the layout of some of the ggtern plot features which are unique to the ternary diagrams , and hence, this package.
By default, 1 column is specified, which means that the plots will be stacked on top of each other in
a single column, however, if say 4 plots are provided to the ellipsis or plotlist, with cols equal
to 2, then this will produce a 2 x 2 arrangement.
In regards to the layout argument (which overrides the cols argument), if it is something like
matrix(c(1,2,3,3), nrow=2, byrow=TRUE), then plot number 1 will go in the upper left, 2 will go in
the upper right, and 3 will go all the way across the bottom - see the last example below.
The arguments x and y represent cartesian coordinates. This is useful if a path is sought that passes
through each point in the ordered set, however, no two lines in the total path cross over each other.
Uses the atan2 function to determine the angle (theta) between each point (x,y) and the centroid of
the data, it then orders based on increasing values of theta.
Value
data.frame object containing the re-ordered input set.
Author(s)
Nicholas Hamilton
Source
http://www.cookbook-r.com/Graphs/Multiple_graphs_on_one_page_(ggplot2)/
Index
coord_tern, 4, 8, 28
CoordTern, 39
CoordTern (coord_tern), 8
custom_percent (suffix_arrow), 38
∗Topic clipping
zzz-depreciated, 53
∗Topic datasets
coord_tern, 8
geom_confidence_tern, 13
geom_density_tern, 15
geom_errorbarX, 16
geom_interpolate_tern, 19
geom_mask, 21
geom_smooth_tern, 21
geom_Xisoprop, 23
geom_Xline, 24
position_jitter_tern, 34
position_nudge_tern, 35
stat_density_tern, 36
∗Topic depreciated
zzz-depreciated, 53
∗Topic polygon
zzz-depreciated, 53
+.gg, 3
data.frame, 53
data_sets_Feldspar, 9
data_sets_Fragments, 10
data_sets_USDA, 12
drawMahal, 34
element_blank, 49
element_line, 41, 42, 49
element_rect, 41, 43
element_ternary (zzz-depreciated), 53
element_text, 41, 42
elements (theme), 41
expression, 29
Feldspar (data_sets_Feldspar), 9
Fragments (data_sets_Fragments), 10
fragments (data_sets_Fragments), 10
aes, 3, 4, 13, 15, 17, 19, 22, 23, 25, 37
aes_, 13, 15, 17, 19, 22, 23, 25, 37
approved_geom (approved_layers), 4
approved_layers, 4
approved_position (approved_layers), 4
approved_stat (approved_layers), 4
arrangeGrob, 6
atan2, 55
atomic_percent (suffix_arrow), 38
gam, 19, 22
geom_blank, 5
geom_confidence, 5
geom_confidence (geom_confidence_tern),
13
geom_confidence_tern, 13
geom_count, 4
geom_curve, 5
geom_density_tern, 5, 15
geom_errorbar, 16
geom_errorbarh, 16
geom_errorbarL, 4
geom_errorbarL (geom_errorbarX), 16
geom_errorbarR, 4
geom_errorbarR (geom_errorbarX), 16
geom_errorbarT, 4
geom_errorbarT (geom_errorbarX), 16
bandwidth.nrd, 14, 37
borders, 13, 15, 17, 20, 22, 37
character, 29
clipPolygons (zzz-depreciated), 53
constructor (ggtern), 27
convenience, 41
convenience (convenience_functions), 7
convenience_functions, 7
56
INDEX
geom_errorbarX, 16
geom_hline, 24
geom_interpolate_tern, 5, 19
geom_jitter, 4, 5
geom_label, 4
geom_line, 4
geom_Lisoprop, 5
geom_Lisoprop (geom_Xisoprop), 23
geom_Lline, 4
geom_Lline (geom_Xline), 24
geom_mask, 5, 21
geom_path, 4
geom_point, 4
geom_polygon, 4
geom_Risoprop, 5
geom_Risoprop (geom_Xisoprop), 23
geom_Rline, 4
geom_Rline (geom_Xline), 24
geom_segment, 4, 9
geom_smooth (geom_smooth_tern), 21
geom_smooth_tern, 5, 21
geom_text, 4
geom_Tisoprop, 5
geom_Tisoprop (geom_Xisoprop), 23
geom_Tline, 4
geom_Tline (geom_Xline), 24
geom_vline, 24
geom_Xisoprop, 23
geom_Xline, 24
GeomConfidenceTern
(geom_confidence_tern), 13
GeomDensityTern (geom_density_tern), 15
GeomErrorbarl (geom_errorbarX), 16
GeomErrorbarr (geom_errorbarX), 16
GeomErrorbart (geom_errorbarX), 16
GeomInterpolateTern
(geom_interpolate_tern), 19
GeomLisoprop (geom_Xisoprop), 23
GeomLline (geom_Xline), 24
GeomMask (geom_mask), 21
GeomRisoprop (geom_Xisoprop), 23
GeomRline (geom_Xline), 24
GeomSmoothTern (geom_smooth_tern), 21
GeomTisoprop (geom_Xisoprop), 23
GeomTline (geom_Xline), 24
ggplot2, 4, 24, 30, 31
ggsave, 26
ggtern, 27
57
ggtern datasets, 10, 12
ggtern-labels (ggtern_labels), 27
ggtern-package (ggtern_package), 29
ggtern.multi (zzz-depreciated), 53
ggtern_labels, 27
ggtern_package, 29
ggtern_themes, 31
grid, 30
grid.arrange (arrangeGrob), 6
HERE, 7, 27, 30
label_formatter, 33
labs, 29
Larrowlab (ggtern_labels), 27
larrowlab (ggtern_labels), 27
latex2exp, 29
layer, 14, 15, 17, 20, 22, 23, 25, 37
limit_tern (tern_limits), 40
limits_tern (tern_limits), 40
list, 30
Llab (ggtern_labels), 27
llab (ggtern_labels), 27
Lline (geom_Xline), 24
lline (geom_Xline), 24
loess, 19, 22
logical, 29, 41, 42
mahalanobis_distance, 34
multi (zzz-depreciated), 53
multiplot (zzz-depreciated), 53
newelements (theme), 41
newtheme (theme), 41
newthemes (theme), 41
numeric, 29, 42, 43
panel.margin.tern (theme), 41
percent_atomic (suffix_arrow), 38
percent_custom (suffix_arrow), 38
percent_weight (suffix_arrow), 38
point.in.sequence (zzz-depreciated), 53
polyclip (zzz-depreciated), 53
position_identity, 5
position_jitter_tern, 5, 34, 35
position_nudge_tern, 5, 34, 35
PositionJitterTern
(position_jitter_tern), 34
PositionNudgeTern
(position_nudge_tern), 35
58
proto, 30
Rarrowlab (ggtern_labels), 27
rarrowlab (ggtern_labels), 27
Rlab (ggtern_labels), 27
rlab (ggtern_labels), 27
Rline (geom_Xline), 24
rline (geom_Xline), 24
scale_L_continuous, 40
scale_L_continuous
(scale_T_continuous), 35
scale_R_continuous, 40
scale_R_continuous
(scale_T_continuous), 35
scale_T_continuous, 35, 40
scale_tern_continuous
(scale_T_continuous), 35
stat_confidence, 5
stat_confidence (geom_confidence_tern),
13
stat_confidence_tern
(geom_confidence_tern), 13
stat_contour, 14
stat_density_tern, 5, 36
stat_identity, 5
stat_interpolate_tern, 5
stat_interpolate_tern
(geom_interpolate_tern), 19
stat_smooth_tern, 5
stat_smooth_tern (geom_smooth_tern), 21
stat_sum, 5
stat_unique, 5
StatConfidenceTern
(geom_confidence_tern), 13
StatDensityTern (stat_density_tern), 36
StatInterpolateTern
(geom_interpolate_tern), 19
StatSmoothTern (geom_smooth_tern), 21
suffix_arrow, 38
Tarrowlab (ggtern_labels), 27
tarrowlab (ggtern_labels), 27
tern.axis (theme), 41
tern.axis.arrow.finish, 53
tern.axis.arrow.sep, 44, 53
tern.axis.arrow.show, 45, 53
tern.axis.arrow.start, 53
tern.axis.hshift, 53
INDEX
tern.axis.ticks.length.major, 53
tern.axis.ticks.length.minor, 53
tern.axis.ticks.primary.show, 51
tern.axis.ticks.secondary.show, 51
tern.axis.vshift, 53
tern.panel.background (theme), 41
tern.panel.expand (theme), 41
tern.panel.grid (theme), 41
tern.panel.grids.ontop (theme), 41
tern.panel.rotate (theme), 41
tern.plot.background (theme), 41
tern_anticlockwise (theme_clockwise), 45
tern_clockwise (theme_clockwise), 45
tern_counterclockwise
(theme_clockwise), 45
tern_limit (tern_limits), 40
tern_limits, 40
tern_stop (zzz-depreciated), 53
ternary-transformation, 39
ternary.options (theme), 41
theme, 41, 41
theme-tern (theme), 41
theme_anticlockwise (theme_clockwise),
45
theme_arrowbaseline, 44
theme_arrowbaseline (zzz-depreciated),
53
theme_arrowcustomlength
(themearrowlength), 43
theme_arrowdefault (themearrowlength),
43
theme_arrowlarge (themearrowlength), 43
theme_arrowlength (themearrowlength), 43
theme_arrowlong (themearrowlength), 43
theme_arrownormal (themearrowlength), 43
theme_arrowshort (themearrowlength), 43
theme_arrowsmall (themearrowlength), 43
theme_bw (ggtern_themes), 31
theme_bw(...), 45
theme_classic (ggtern_themes), 31
theme_classic(...), 45
theme_clockwise, 45
theme_complete, 45
theme_convenience
(convenience_functions), 7
theme_counterclockwise
(theme_clockwise), 45
theme_custom (ggtern_themes), 31
INDEX
theme_dark (ggtern_themes), 31
theme_dark(...), 45
theme_darker (ggtern_themes), 31
theme_darker(...), 45
theme_elements (theme), 41
theme_gray (ggtern_themes), 31
theme_gray(...), 45
theme_grey (ggtern_themes), 31
theme_gridsontop, 46
theme_hidearrows, 44
theme_hidearrows (theme_noarrows), 47
theme_hidegrid (theme_showgrid), 49
theme_hidegrid_major (theme_showgrid),
49
theme_hidegrid_minor (theme_showgrid),
49
theme_hidelabels (theme_showlabels), 50
theme_hideprimary (theme_showprimary),
50
theme_hidesecondary
(theme_showprimary), 50
theme_hideticks (theme_showprimary), 50
theme_hidetitles (theme_showtitles), 52
theme_legend_position, 46
theme_light (ggtern_themes), 31
theme_light(...), 45
theme_linedraw (ggtern_themes), 31
theme_linedraw(...), 45
theme_minimal (ggtern_themes), 31
theme_minimal(...), 45
theme_noarrows, 47
theme_nogrid (theme_showgrid), 49
theme_nogrid_major (theme_showgrid), 49
theme_nogrid_minor (theme_showgrid), 49
theme_nolabels (theme_showlabels), 50
theme_noprimary (theme_showprimary), 50
theme_nosecondary (theme_showprimary),
50
theme_noticks (theme_showprimary), 50
theme_notitles (theme_showtitles), 52
theme_novar_tern, 47
theme_rgbg (ggtern_themes), 31
theme_rgbg(...), 45
theme_rgbw (ggtern_themes), 31
theme_rgbw(...), 45
theme_rotate, 48
theme_showarrows, 28, 44
theme_showarrows (theme_noarrows), 47
59
theme_showgrid, 49
theme_showgrid_major (theme_showgrid),
49
theme_showgrid_minor (theme_showgrid),
49
theme_showlabels, 50
theme_showprimary, 50
theme_showsecondary
(theme_showprimary), 50
theme_showticks (theme_showprimary), 50
theme_showtitles, 52
theme_tern_bw (ggtern_themes), 31
theme_tern_classic (ggtern_themes), 31
theme_tern_gray (ggtern_themes), 31
theme_tern_grey (ggtern_themes), 31
theme_tern_minimal (ggtern_themes), 31
theme_tern_nogrid (theme_showgrid), 49
theme_tern_nogrid_major
(theme_showgrid), 49
theme_tern_nogrid_minor
(theme_showgrid), 49
theme_tern_rgbg (ggtern_themes), 31
theme_tern_rgbw (ggtern_themes), 31
theme_ticksinside (theme_ticksoutside),
52
theme_ticksoutside, 52
theme_void (ggtern_themes), 31
themearrowlength, 43
themeelements (theme), 41
Tlab (ggtern_labels), 27
tlab (ggtern_labels), 27
Tline (geom_Xline), 24
tline (geom_Xline), 24
tlr2xy, 39
tlr2xy (ternary-transformation), 39
unit, 41, 42
USDA (data_sets_USDA), 12
weight_percent, 28
weight_percent (suffix_arrow), 38
Wlab (ggtern_labels), 27
wlab (ggtern_labels), 27
xlab, 27, 28
xy2tlr, 39
xy2tlr (ternary-transformation), 39
ylab, 27, 28
60
zlab (ggtern_labels), 27
zzz-depreciated, 53
INDEX
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertisement