[Rd] Re: argument ordering (was <blank>)

Paul Murrell paul@stat.auckland.ac.nz
Tue, 17 Jul 2001 10:59:49 +1200


I am trying to change the number of the ticks on each axis, but every time I
can not succeed and receive the error message shown below even I use the
default values:

   Error in axis(side, at, labels, tick, line, pos, outer, font, vfont, ...)
        location and label lengths differ, 6 != 3

The problem is that the "lab" parameter is being passed down (via plot.ts)
to axis in a "..." argument, but it is being matched to the "labels"
argument in axis().

In other words, axis() thinks you are saying "labels=c(5, 5, 7)".   This is
not your fault;  it is an unfortunate interaction between partial matching
of argument names and the "..." argument.

A simple workaround would be ...

    op <- par(lab=c(5, 5, 7)

... a more long-term solution will require some more thought ...

[to R-devel:

    (i) could put the labels argument at the end of the list -- i.e.,
axis(side, at, tick, line, pos, outer, font, vfont, ..., labels) but then
using "lab" as an abbreviation for "labels" would then get consumed as a
par() setting (?)

    (ii) could put explicit "lab" argument in the list too -- i.e.,
axis(side, at, labels, tick, line, pos, outer, font, vfont, lab, ...) (?)

    (iii) ... ?]


r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch