Closed discoleo closed 2 years ago
Below is the corrected code:
### Other: ---< arrowInverted = function(x, y, d=1, lwd=1, d.head=c(-d,d), d.lines=0, h.lwd=lwd, col="red", scale=1, join=0) { slope = compute_slope(x, y); ### Head p = shiftPoint(c(x[2], y[2]), slope=slope, d = d, scale=scale) pV = shiftLine(p, slope=slope, d=d.head, scale=scale); ahead = lines(c(pV[1,1], x[2], pV[2,1]), c(pV[1,2], y[2], pV[2,2]), lwd=h.lwd, col=col); ### Arrow Tail arrow = lines(x, y, lwd=lwd, col=col); ### Full Arrow lst = list(Arrow=arrow, Head=ahead); class(lst) = c("arrow"); # Plot lines: lines(lst, col=col); invisible(lst); }
Modified.
arrowInverted
Below is the corrected code: