Skip to content
Prev 51328 / 63424 Next

For integer vectors, `as(x, "numeric")` has no effect.

We do need an explicit method here, I think.

The issue is that as() uses methods for the generic function coerce() but cannot use inheritance in the usual way (if it did, you would be immediately back with no change, since "integer" inherits from "numeric").

Copying in the general method for coercing to "numeric" as an explicit method for "integer" gives the expected result:
[1] "coerce"
[1] "double"

Seems like a reasonable addition to the code, unless someone sees a problem.

John
On Dec 7, 2015, at 3:37 PM, Benjamin Tyner <btyner at gmail.com> wrote: