Learn R Programming

DirichletReg (version 0.6-2)

Simplex-Transformations: Transform Compositional Data for a Simplex

Description

These functions transform a matrix with three or four components to fit into a two- or three-dimensional simplex (triangle or tetrahedron).

Usage

toSimplex(x)

toTernary(abc)
toTernaryVectors(c1, c2, c3)

toQuaternary(abcd)
toQuaternaryVectors(c1, c2, c3, c4)

Arguments

x
a matrix-like object with 3 or 4 columns.
abc
a matrix-like object with 3 columns.
abcd
a matrix-like object with 4 columns.
c1
a numeric vector with values of the first component.
c2
a numeric vector with values of the second component.
c3
a numeric vector with values of the third component.
c4
a numeric vector with values of the fourth component.

Value

  • The function returns a matrix object with coordinates in two or three dimensions

encoding

UTF-8

Details

Most of these functions are only used internally, but sometimes it might be useful to plot custom ternary or quaternary graphics. Note that, apart from toSimplex(), functions do not have any checks, so it is advisable to use this function if elements are added to plots or own graphics are created.

Examples

Run this code
# create a DirichletRegData object from the Arctic Lake data
"to be added"

Run the code above in your browser using DataLab