[R] mtext with at=NULL

Duncan Murdoch murdoch at stats.uwo.ca
Thu Feb 25 16:42:37 CET 2010


On 25/02/2010 8:58 AM, Ulrike Feldmann wrote:
> Hello,
>
> in the help of mtext I found
>
> "at: If ‘length(at)==0’ (the default), the location will be determined
> by ‘adj’"
>
> But if I use mtext( "hello world", at=NULL) there comes the following
> error message:
>
> Fehler in mtext("hallo Welt", side = 3, adj = NA, at = NULL) :
>   'at' mit Länge 0 angegeben
>
> So the help says it is ok to use at with length(at) == 0 but if I use an
> at with length(at) == 0 I get an error message.
>
> This is a bug, isn't it?

I'd say it's a documentation error:  it claims that the default is 
length 0, but the default is NA, which is length 1.  The actual test in 
the code uses adj when a C equivalent of is.finite(at) is TRUE, so I'll 
change the docs to match the behaviour, rather than changing the 
behaviour to match the docs.

Duncan Murdoch



More information about the R-help mailing list