Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

simplexCoords

Convert 3-d coordinates to 2-d probability simplex coordinates


Description

Convert from 3-d Cartesian coordinates to 2-d coordinates suitable for plotting in the probability simplex.

Usage

simplexCoords(v)

Arguments

v

vector of 3 non-negative numbers, not summing to 0

Details

Applies an affine coordinate trandformation that maps the centroid (1/3,1/3,1/3) to the origin (0,0), and rescales so that the line segments between (1,0,0), (0,1,0), and (0,0,1) are mapped to segments of length 1.

An input vector v is first normalized so its component sum to 1 before the map is applied.

Value

2-d coordinates to plot normalized point in simplex

See Also

Examples

simplexCoords(c(15,65,20))

MSCquartets

Analyzing Gene Tree Quartets under the Multi-Species Coalescent

v1.1.0
MIT + file LICENSE
Authors
Elizabeth Allman [aut], Hector Banos [aut], Jonathan Mitchell [aut], John Rhodes [aut, cre] (<https://orcid.org/0000-0001-9921-1091>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.