I would like to use the arrows
function in R to plot different shaped arrow heads onto a network graph (I'm using NetworkD3 and iGraph which both use the arrows
function). This works great at the moment but I would like some to be normal triangular arrow heads and others to be 'T' shaped arrow heads. The arrows
function says:
arrows(x0, y0, x1 = x0, y1 = y0, length = 0.25, angle = 30,
code = 2, col = par("fg"), lty = par("lty"),
lwd = par("lwd"), …)
code = integer code, determining kind of arrows to be drawn.
If code = 1
an arrowhead is drawn at (x0[i], y0[i])
and if code = 2
an arrowhead is drawn at (x1[i], y1[i])
. If code = 3
a head is drawn at both ends of the arrow. Unless length = 0
, when no head is drawn.
Currently I'm using code
to determine what direction the arrows are drawn in, all well and good, but I was wondering if it was possible to change code = 1
to result in a "T" shaped arrow head, rather than an arrow going in the opposite direction.
I tried looking for packages that might change this but I had no luck and I couldn't seem to figure out how to edit the arrows function by myself, if anyone could give me some pointers that would be wonderful!