Revision 4f2efb4ed8831a90968ef063d2403d675c84dae3 authored by Matthias Templ on 26 November 2013, 12:55:44 UTC, committed by cran-robot on 26 November 2013, 12:55:44 UTC
1 parent 2ad963b
Raw File
ternaryDiagPoints.R
ternaryDiagPoints <- function(x, ...){
	s <- rowSums(x)
	if (any(s <= 0)) 
		stop("rowSums of the input data x must be positive.")
	x <- x/s
	top <- sqrt(3)/2
	xp <- x[, 2] + x[, 3]/2
	yp <- x[, 3] * top
	points(xp, yp, ...)
}
back to top