Learn R Programming

ggtern (version 1.0.6.1)

zzz-overloaded: Overloaded ggplot2 functions

Description

INTERNAL FUNCTIONS (Overloaded from ggplot2): The source of the following functions originate from ggplot2, however, minor patches were required in order for them to function under the ggtern framework. Patches were mainly to do with handling the new theme elements and heirarchies.

panel_scales is a local copy of the ggplot2 function that calculates the scales for each panel, patched for the ternary system.

calculate_stats is a local copy of the ggplot2 function that calculates various stats for each layer.

train_ranges is a local copy of the ggplot2 function that computes ranges and dimensions of each panel, using the coord, and patched for the ternary system.

"%+%" is a local copy of the ggplot2 add operator, no change other than exporting from the ggtern namespace

add_ggplot is a local copy of the ggplot2 method that adds elements to an existing gg object.

validate_element is a local copy of the ggplot2 function which checks the validity of a given theme element against the elements table. Since the .elements_tree is an internal function, which is not exported, and modifications could not be made, a new (and equivalent) .element_tree is created within ggtern to handle the new theme elements created within this package.

opts is deprecated. See the theme function.

plot_theme is a local copy of the method that determines the net theme between a plot and the current global theme.

add_theme is a local copy of the ggplot2 function which modifies the current theme, by a proposed theme. It is slightly modified to handle 'logical' values the same way it handles 'character' or 'numeric' values, which do not inherit from 'element' objects.

"%+replace%" is a local copy of the ggplot2 replace operator, no different other than being exported from the ggtern namespace.

update_theme is a local copy of a ggplot2 function, which copies elements from the new theme into an old theme.

calc_element is a local copy of the ggplot2 function which determines the net element based on inheritances, given input theme.

combine_elements is a local copy of the ggplot2 function that combines two theme elements

check_required_aesthetics is a local copy of the ggplot2 function that checks if the required aesthetics are present. This is used by geoms and stats to give a more helpful error message when required aesthetics are missing.

Usage

panel_scales(panel, i)

calculate_stats(panel, data, layers)

train_ranges(panel, coord)

e1 %+% e2

add_ggplot(p, object, objectname)

validate_element(el, elname)

theme_update(...)

opts(...)

plot_theme(x)

theme_get()

theme_set(new)

add_theme(t1, t2, t2name)

e1 %+replace% e2

update_theme(oldtheme, newtheme)

calc_element(element, theme, verbose = FALSE)

combine_elements(e1, e2)

check_required_aesthetics(required, present, name)

Arguments

panel
the particular panel
i
index number
data
a list of data frames (one for each layer)
layers
list of layers
e1
first element
e2
second element
p
plot
object
to add
objectname
name of obeject
el
the element
elname
the element name
...
Arguments to be passed on to the theme function.
x
gg object
new
new theme (a list of theme elements)
t1
A theme object
t2
A theme object that is to be added to t1
t2name
A name of the t2 object. This is used for printing informative error messages.
oldtheme
previous theme object
newtheme
new theme object
element
The name of the theme element to calculate
theme
A theme object (like theme_grey())
verbose
If TRUE, print out which elements this one inherits from
name
of object for error message
character
vector of required aesthetics
character
vector of present aesthetics

format

functions and objects

See Also

theme_update

opts

add_theme