Is there anyway of connecting observations in ggtern by a straight line between each consecutive point? My code is:
require(ggtern)
x <- data.frame(
A = c( 0, 0, 1, 0.1, 0.6, 0.2,0.8,0.33 ),
B = c( 0, 1, 0, 0.3, 0.2, 0.8, 0.1,0.33),
C = c( 1, 0, 0, 0.6, 0.2, 0.0, 0.1,0.33)
)
ggtern(data=x,aes(A,B,C)) +
geom_point(fill="blue",type="l",shape=21,size=2)
theme_classic() )
aa <- ggtern(data=x,aes(A,B,C)) + geom_point(fill="blue",type="l",shape=21,size=2)+ theme_classic()
aa + geom_segment(aes(x=x[1:4,1],xend=x[5:8,1],y = x[1:4,2],yend=x[5:8,2],z=x[1:4,3], zend=x[5:8,3]),col=2)
– Romani=seq(1,7,2) ; aa + geom_segment(aes(x=x[i,1],xend=x[(i+1),1],y = x[i,2],yend=x[(i+1),2],z=x[i,3], zend=x[(i+1),3]),col=2)
– Romangeom_path(...)
– jlhoward