[Rd] documenation for arrows() is backwards (PR#7839)

From: <hoffman.mm+R-project.org_at_ebi.ac.uk>
Date: Thu 05 May 2005 - 10:40:43 GMT

Full_Name: Michael Hoffman
Version: 2.1.0
OS: Linux (Fedora Core 3, kernel 2.6.11-1.14_FC3) Submission from: (NULL) (

help(arrows) says:


     arrows(x0, y0, x1, y1, length = 0.25, angle = 30, code = 2,
            col = par("fg"), lty = NULL, lwd = par("lwd"), xpd = NULL)


     If 'code=2' an arrowhead is drawn at '(x0[i],y0[i])' and if
     'code=1' 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.


If you do:

plot(c(-1, 1), c(-1, 1), col=0)
arrows(x0=0, y0=0, x1=0, y1=1, code=2)

it is pretty clear that the arrowhead is drawn at x1, y1 with code=2. If you switch to code=1, the arrowhead is drawn at x0, y0. Either the documentation or the function is incorrect.

R-devel@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Thu May 05 20:47:22 2005

This archive was generated by hypermail 2.1.8 : Mon 20 Feb 2006 - 03:21:05 GMT