Skip to content
Prev 8479 / 21312 Next

[Bioc-devel] [Rd] For integer vectors, `as(x, "numeric")` has no effect.

Or maybe the "right" concept is that "numeric" is a virtual class
with 3 subclasses: "complex", "double", and "integer". Anyway it's
probably too late for implementing the "right" concept so it doesn't
really matter.

Thanks Martin for offering to fix the as(1L, "numeric") bug. Very
much appreciated. I guess that means fixing the class(x) <- "numeric"
bug on integer vectors:

   > x <- 1L
   > class(x) <- "numeric"
   > class(x)
   [1] "integer"

My wish for 2016: that selectMethod() always tells the truth. For
example selectMethod("coerce", c("integer", "numeric")) doesn't
in a fresh session, only after you call as(1L, "numeric")). Full
story here:

   https://stat.ethz.ch/pipermail/r-devel/2010-April/057098.html

Thanks,
H.
On 12/19/2015 10:09 AM, John Chambers wrote: