I was wondering if anyone could help me plot lines in R with multiple arrows in them, like this:
--->--->--->--->
Thanks in advance!
Simulair to DWin this is what I came up with:
arrowLine <- function(x0,y0,x1,y1,nArrow=1,...)
{
lines(c(x0,x1),c(y0,y1),...)
Ax=seq(x0,x1,length=nArrow+1)
Ay=seq(y0,y1,length=nArrow+1)
for (i in 1:nArrow)
{
arrows(Ax[i],Ay[i],Ax[i+1],Ay[i+1],...)
}
}
Basically it overlaps several arrows in a line, but does get the desired result (I assume straigth lines):
plot(0:1,0:1)
arrowLine(0,0,1,1,4)

The real tricky part comes to getting the arrow to got o the edge of points instead of the center. Is that needed?