
Project 3D probability coordinates onto 2D simplex coordinates
Source:R/plot_simplex.R
project2D.Rd
Project three probabilities that sum to one (e.g., the marginal probabilities of the 3Rs) onto the coordinates of a 2D simplex centred at the origin (i.e., a triangle centred at (0,0) with unit sides). Each probability is proportional to the distance between the point and the side opposite to the corner corresponding to the probability.
Value
A numeric vector of two coordinates that can be used to plot the
probability vector v
on the origin-centred 2D simplex (see
plot_simplex()
), where the top, left, and right vertices of the simplex
correspond with the first, second and third entries of v
respectively.
Examples
project2D(v = c(0.75,0.20,0.05))
#> x y
#> -0.0750000 0.3608439