Internal Functions

Share:

Description

INTERNAL FUNCTIONS: ggtern makes use of several non-exported internal functions, list are as follows:

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

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.

tern_dep is a function that gives a deprecation error, warning, or messsage, depending on version number, it is based of the gg_dep function which is used inside the ggplot2 package

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

joinCharacterSeries is a function will turn a character vector from the format c('a','b','c') to a single string in the following format: "'a','b' and 'c'"

identityInv is a function which returns exactly the same as identity however it can be used within transformation logic via do.call(...) in the same way as for example ilrInv is to ilr.

getFormulaVars is a function that returns a list of either dependent or independent variables used in an input formula

Function to add missing scales and other items to the plot and its coordinates sytem

Function to add clipping mask if it isn't already present

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
ifthenelse(x, a, b)

is.numericor(A, B)

find_global_tern(name, env = environment(), mode = "any")

tern_dep(version, msg)

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

joinCharacterSeries(x, lastWord = "and")

identityInv(z)

getFormulaVars(x, dependent = TRUE)

scales_add_missing_tern(plot)

layers_add_or_remove_mask(plot)

Arguments

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 numeric

B

numeric value to return if A is NOT numeric

name

character name of object to search for

env

environment to search within as first priority

mode

the mode to search within

version

The last version of ggplot2 where this function was good (in other words, the last version where it was not deprecated).

msg

The message to print.

label

character label

suffix

chacater suffix behind each label

sep

the seperator between label and suffix

...

additional arguments

dependent

whether to return the dependent variables (TRUE) or the indpenedent variables (FALSE)

plot

ggplot object

latex

logical as to whether latex formats should be parsed

x

character vector

x

input object

x

formula object

ggplot

object

Author(s)

Nicholas Hamilton

Nicholas Hamilton

Nicholas Hamilton

Nicholas Hamilton

Nicholas Hamilton

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.