Learn R Programming

⚠️There's a newer version (3.5.0) of this package.Take me there.

ggtern

An extension to ggplot2, for the creation of ternary diagrams.

ggtern is a package that extends the functionality of ggplot2, giving the capability to plot ternary diagrams for (subset of) the ggplot2 proto geometries. 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.

ggtern is a package that is based on (extends) the very popular ggplot2, 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 ggtern.

Installation

Install the latest release on CRAN, install just like any other R package:

  install.packages('ggtern')

To install the development / working version, use the devtools package:

  devtools::install_git('https://bitbucket.org/nicholasehamilton/ggtern')

Contributing

Please contribute push/pull requests via BitBucket repository. Financial contributions, where possible, are very much appreciated. Please navigate to the ggtern website if you are feeling generous...

Authors

Nicholas Hamilton [aut, cre]

License

This project is licensed under GPL2 - see the LICENSE for details.

Acknowledgments

HUGE thanks to Hadley Wickham and all those that have controbuted to the ggplot2 package, without which, this would not be possible.

Copy Link

Version

Install

install.packages('ggtern')

Monthly Downloads

3,222

Version

2.2.0

License

GPL-2

Maintainer

Nicholas Hamilton

Last Published

November 23rd, 2016

Functions in ggtern (2.2.0)

data_Fragments

Grantham and Valbel Rock Fragment Data
theme_arrowlength

Change the Length of the Ternary Arrows
theme_bordersontop

Render Borders on Top
draw_key_tern

Key drawing functions
geom_mask

Apply Manual Clipping Mask
ggplot_gtable

Build a plot with all the usual bits and pieces.
position_jitter_tern

Jitter Ternary Points
ggplot

Create a new ggplot plot.
position_nudge_tern

Nudge Ternary Points.
tern_limits

Restrict Ternary Limits
theme_convenience_functions

Theme Convenience Functions
ternary_transformation

Ternary / Cartesian Transformation
theme_gridsontop

Render Grids on Top
breaks_tern

Generate Axis Breaks
data_Feldspar

Elkin and Groves Feldspar Data
data_USDA

USDA Textural Classification Data
geom_Xline

Fixed Value Lines
ggplot_build

Build ggplot for rendering (ggtern version).
theme_latex

Parse Labels w Latex Markup
theme_nomask

Show or Hide the Clipping Mask
theme_legend_position

Position Legend in Convenient Locations
theme_showprimary

Show or Hide the Primary/Secondary Ticks
kde2d.weighted

Two-Dimentional Kernel Density Estimation (Weighted)
label_formatter

label_formatter is a function that formats / parses labels for use in the grid.
scale_X_continuous

Ternary Position Scales
strip_unapproved

Strip Unapproved Layers
zzz-depreciated

Depreciated Functions
annotation_raster_tern

Annotation: High-performance rectangular tiling (ggtern version)
arrangeGrob

Arrange multiple grobs on a page (ggtern version)
geom_point_swap

Points (Colour and Fill Swapped), as for a scatterplot
geom_smooth_tern

Add a Smoothed Conditional Mean.
+.gg

Plot Construction
zzz-overloaded

Overloaded ggplot2 functions
theme_clockwise

Direction of Ternary Rotation
theme_complete

List of Available Themes
theme_rotate

Rotate Ternary Diagram
theme_noarrows

Show or Hide the Ternary Arrows
transform_position_tern

Convenience function to transform all position variables in a ternary plot
zzz-internal

Internal Functions
ggsave

Save a ggplot (or other grid object) with sensible defaults (ggtern version)
ggtern_labels_arrow_suffix

Atomic, Weight or Custom Percentage Suffix
mahalanobis_distance

Mahalanobis Distance
labels_tern

Generate Axis Labels
aes

Modified Aesthetic Mappings
annotate

Create an annotation layer (ggtern version).
ggtern_labels

Change Axis labels and legend titles
ggtern_package

Ternary Diagrams in R
theme_showlabels

Show or Hide Axis Ticklabels
predictdf2d

Prediction data frame
rgb2hex

Convert RGB to HEX Color
theme_showgrid

Show or Hide Grid
theme_ticksoutside

Place Ticks Inside or Outside
theme_showtitles

Show or Hide the Axis (Apex) Titles
ggtern_themes

ggtern themes
ggtern

ggtern Constructor
theme_mesh

Create Grid Mesh
theme_novar_tern

Blank one variable's annotations in ternary plot
theme

Set theme elements (ggtern version)
theme_zoom_X

Zoom on Plot Region