Description Fields Methods Note Examples
This class and accompanying functions are designed to help with the creation of ternary graphs and the manipulatoin of ternary data. The class uses snake_names for functions and methods, camel-case for variables, and Pascal Case for everything else. For graphical methods and functions, I have tried to emulate similar functions' parameter names.
myCoord
a numeric matrix
myCenter
a numeric list of xy-coordinates
myStretch
a numeric list of length two
myIJK
a numeric matrix, dimensions 4X2, i is first and last
get_ijk(raw = FALSE, inplace = FALSE)
Returns myIJK. If raw=TRUE, returns default ijk-vectors. If inplace=TRUE, recalculates myIJK or sets myIJK to default values.
get_leaf(data)
Given t-coordinates, returns what section of the t-plot they are in.
get_xy(data = myCoord)
Given t-coordinates, returns xy-coordinates. Defaults to myCoord.
initialize(data_ = NA, columns_ = c(1, 2, 3), center_ = NA,
xFrame_ = NA, yFrame_ = NA)
Initializes a TeaSet object, used when TeaSet$new() is called. No arguments necessary.
p_center_frame(xFrame, yFrame, inplace = FALSE)
Private method. Returns center of xFrame and yFrame. If inplace=TRUE, sets myCenter<<-center
p_color_center(xy, ...)
Private method. Works with tea_plot to extract col variable from ..., and handle gradient and contrast colors.
p_normalize_ternary_pt(x = myCoord)
Private method. For each ternary point, calls p_redistribute negatives, than divides all by their max value.
p_plot(..., alpha)
private function, removes variables after ... before calling its namesake
p_points(..., alpha)
private function, removes variables after ... before calling its namesake
p_polygon(..., alpha)
private function, removes variables after ... before calling its namesake
p_redistribute_negatives(x = myCoord)
Private method. Given ternary-coordinates, redistributes negative values for each axis to the other two axes as half their value.
p_section_key(x = NULL)
Private method. Given a list, returns a list with names set to section names
p_segments(..., alpha)
private function, removes variables after ... before calling its namesake
p_size_frame(xFrame = NA, yFrame = NA, inplace = FALSE)
Private method. Returns the difference between xy-values of xFrame and yFrame. If inplace=TRUE, sets myStretch<<-newStretch
p_text(..., alpha)
private function, removes variables after ... before calling its namesake
tea_contrast_colorize(x = myCoord, alpha = 0.3)
Returns a list of colors based on sections of provided t-points.
tea_frame_plot(...)
Draws the border triangle around a t-plot. May also provide a color to shade the background
tea_gradient_background(rows = 30, border = NA, alpha = 0.1, ...)
Creates a gradient of colors in the background of a t-plot. The more rows (of triangles), the finer the gradient.
tea_gradient_colorize(x = myCoord, alpha = 0.3)
Returns a list of colors for t-points based on their locations within t-plot
tea_label_axes(axis.labels = "default")
Labels the axes of a t-plot
tea_lines(x = NULL, y = NULL, z = NULL, draw = TRUE,
overDraw = c(FALSE, FALSE), col = "grey", ...)
Draws a line given a single value along one of the ternary axes. Points should be from 0-1. Works wtih lists of points. Overdraw makes the line go slightly over the border triangle.
tea_plot(data = myCoord, dataLabels = NA, main = "", newPlot = TRUE,
bullseye = FALSE, ticks = NA, axis.labels = "default",
col.axis = "grey", ...)
Creates a t-plot. If newPlot=FALSE, will instead draw atop current plot.
tea_ticks(axes = 4, col.axis = "grey")
Draws tick-lines for all three axes and labels them.
tea_triangle(r = 1, xy = myCenter, jCorner = FALSE, raw = FALSE,
draw = TRUE, recursing = FALSE, col = "gradient", alpha = 0.3, ...)
Creates triangle similar to the triangle around the t-plot. r is its size relative to the border-triangle, and xy is its center. If jCorner=TRUE, instead draws from the j-vector's corner.
tea_xy_gradient_colorize(x, alpha = 0.3, rotate_hue = 0, raw = FALSE)
Returns a list of colors for xy-points based on their locations within t-plot
allows for blank class to be built
1 2 3 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.