[R] Re: argument ordering (was <blank>)
paul at stat.auckland.ac.nz
Tue Jul 17 00:59:49 CEST 2001
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
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 ...
(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-help 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-help-request at stat.math.ethz.ch
More information about the R-help