From paul@stat.auckland.ac.nz  Mon Jul 16 23:59:49 2001
From: paul@stat.auckland.ac.nz (Paul Murrell)
Date: Tue, 17 Jul 2001 10:59:49 +1200
Subject: [Rd] Re: argument ordering (was <blank>)
References: <OE27Vn20lbhsKd6QR7j0001b0c3@hotmail.com>
Message-ID: <008601c10e4b$04448520$175dd882@stat.auckland.ac.nz>

Hi


---snip---
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:

>plot.mts(infldata1[,3:4],lty=c(1:2),plot.type="single",lab=c(5,5,7))
   Error in axis(side, at, labels, tick, line, pos, outer, font, vfont, ...)
:
        location and label lengths differ, 6 != 3
---snip---


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)
    plot.mts(infldata1[,3:4],lty=c(1:2),plot.type="single")
    par(op)

... 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) ... ?]

Paul



-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


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