Paul:
I figured that would be the problem.
I encountered the issue when I tries to check arguments in a validDetails
method for a grob.
Could one substitute the following function in the grid namespace?
is.numeric <- function(x)if(is.unit(x))TRUE else is.numeric(x)
(or make the first clause FA
The following seems to me to be at least a perverse trap, if not an =
outright
bug:
> is.numeric(unit(1,"npc"))
[1] TRUE
> is.numeric(1*unit(1,"npc"))
[1] FALSE
> is.numeric(unit(0,"npc") +unit(1,"npc"))
[1] FALSE
...etc.
i.e. is.numeric() appears to be TRUE for class "unit" but false for =
class
The following code should suffice to document the problem.
Things work properly in the following:
> x <- unit.c(unit(5,"mm"),unit(3,"npc"))
> x
[1] 5mm 3npc
> rep(x,2)
[1] 5mm 3npc 5mm 3npc
> rep(x, e=2)
[1] 5mm 5npc 3mm 3npc
> rep(x,c(2,2))
[1] 5mm 5npc 3mm 3npc
However, not so for:
> x
Folks:
Problem: [<-.data,frame() is losing attributes under certain curcumstances
shown below.
I think this is a bug, at least in documentation, as I was unable to find
explicit documentation of the behavior. Indeed, the only documentation I
found told me attributes are preserved. Here is a de
There is either a bug or undocumented feature (afaics) in match.arg that
requires the length of the arg argument to be no longer than the length of
the choices argument even when several.ok is TRUE. Here is a reproducible
example:
first:
> sessionInfo()
R version 2.5.0 Patched (2007-04-26 r4132
Gents: (alas, I think no ladies need to be included in the salutation)
The apply() Help file says
"...
If the calls to FUN return vectors of different lengths, apply returns a
list of length dim(X)[MARGIN]. "
Shouldn't that be:
"If the calls to FUN return vectors of different lengths, apply ret
To R-Developers:
I wish to report what I believe are inconsistencies between Green Book
descriptions and R methods behaviors. I **realize** that R does not
guarantee total consistency with the Green Book; therefore I leave it to you
to decide whether any of this is a bug, design choice, or a need