Learn R Programming

ggtern (version 1.0.6.1)

zzz-internal: Internal Functions

Description

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

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

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

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

set_last_coord set the last coordinate system.

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

rd_aesthetics is a helper function for documenting aesthetics in R help files.

rd_theme is a helper function for documenting theme_elements in R help files.

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

is.numericor function takes input arguments A and B and returns A if A is numeric, 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 function as provided in ggplot2

find_global_tern 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

Usage

Geom

ggint

get_last_coord()

set_last_coord(new)

Statnew

rd_aesthetics(type, name)

rd_theme()

ifthenelse(x, a, b)

is.numericor(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_tern(name, env = environment())

remove_outside(data)

Arguments

new
the coordinate system to set
type
geom, stat or coord
name
character name of object to search for
x
logical input to check
a
value to return if x is TRUE
b
value to return if x is FALSE
A
value to return if A is numeric
B
value to return if A is NOT numeric
coordinates
ggtern coordinate system, inheriting "ternary" and "coord" classes.
verbose
logical indicating verbose reporting to console
expand
numeric do define the max and min acceptable limits above and below the intended range.
label
character label
suffix
chacater suffix behind each label
...
not used
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.
env
environment to search within as first priority
data
data.frame

format

functions and objects