Learn R Programming

ggtern (version 1.0.2.0)

internal: Internal Functions

Description

INTERNAL FUNCTIONS (native to ggtern): ggtern makes use of several non-exported internal functions, a list of the internal functions is as follows:

ggint is a structure which holds all the internal functions from the ggplot2 namespace, which can be used conveniently via ggint$ABC.

Statnew is a local copy of the ggplot2 Stat top-level proto

Geom is a local copy of the ggplot2 Gom top-level proto

ifthenelse function takes input arguments x, a and b and returns a if x is TRUE, else, returns b

get_tern_extremes determines the limiting ternary coordinates given input coordinates.

arrow_label_formatter is a function that formats the labels directly adjacent to the ternary arrows.

calc_element_plot Calculates the element properties, by inheriting properties from its parents, and compares to whether the local plot overrides this value. Based largely off the calc_element as provided in ggplot2

find_global is a function that conducts a named search for the name object instance, within the env environment. If an instance doesn't exist within the env environment, a search is then conducted within the ggtern and ggplot2 namespaces (in that order). This is a modified version of the original source as provided in ggplot2, which has the same functionality, however, the modification is such that the function now additionally searches within the ggtern namespace prior to the ggplot2 namespace.

remove_outside is a function that removes, from an input datases, all the rows wich are outside the ternary plot area

sink_density is a function which permits contours on the ternary surface, without running over the ternary borders.

get_last_coord is a function that returns the last coordinate system used.

set_last_coord set the last coordinate system.

cullAndConstrain is a function that is not implemented at this point in time, ignore it.

arrow is an exported instance of the imported grid arrow function

Usage

ggint

Statnew

Geom

ifthenelse(x, a, b)

get_tern_extremes(coordinates, verbose = F, expand = 0)

arrow_label_formatter(label, suffix = "", ..., sep = "/")

calc_element_plot(element, theme = theme_update(), ..., plot = NULL, verbose = F)

find_global(name, env = environment())

remove_outside(data)

sink_density(df, remove = TRUE, coord = stop("coord is required"))

get_last_coord()

set_last_coord(new)

cullAndConstrain(data)

Arguments

x
logical input to check
a
value to return if x is TRUE
b
value to return if x is FALSE
coordinates
ggtern coordinate system, inheriting "ternary" and "coord" classes.
verbose
logical indicating verbose reporting to console
expand
numeric value to
label
character label
suffix
chacater suffix behind each label
sep
the seperator between label and suffix
element
the element name to calculate
theme
the theme to inherit from
plot
the plot to check locally for theme element, NULL is ok.
...
not used
name
character name of object to search for
env
environment to search within as first priority
data
data.frame
df
data.frame
remove
boolean remove or make zero
coord
coordinates of the type 'ternar', ie coord_tern()
new
the coordinate system to set

Value

  • get_tern_extremes returns data.frame representing the T, L and R amounts (Columns) at each of the tips (extremes) of the ternary plot area (Rows)

    find_global returns an instance of the named object (if it exists), or NULL (if it does not).

    get_last_coord returns the current coordinate system

format

functions and objects

See Also

calc_element

arrow

Examples

Run this code
get_tern_extremes(coordinates = coord_tern())
arrow_label_formatter("TOP","Wt.%",sep="/")
find_global('scale_x_continuous')

Run the code above in your browser using DataLab