Skip to content
Prev 36368 / 63424 Next

as(1:4, "numeric") versus as.numeric(1:4, "numeric")

Hi John,
John Chambers wrote:
The *definition* of method selection is what it is. And it's a fact that
the rules are different for as(). Hence selectMethod("coerce", ...) or
selectAsMethod() should reflect this.
Just to clarify, I'm not proposing to change the *rules* of method
selection. The standard rules would remain exactly the same, and
the special rules used by as() (specified in its man page) would
also remain exactly the same. What would change however is that
selectMethod("coerce", ...) would not be broken anymore i.e. it
would not corrupt the table of "coerce" methods anymore, and it
would return the right method (as specified in the specs).

I hope I made the point that it's not about making things more
complicated ;-)
That sounds all good to me.

Thanks,
H.