[Rd] Should as() find an ANY method even for an 'unregistered' S3 class?
Martin Maechler
m@ech|er @end|ng |rom @t@t@m@th@ethz@ch
Thu Mar 19 10:11:20 CET 2026
>>>>> Michael Chirico
>>>>> on Wed, 18 Mar 2026 10:40:11 -0700 writes:
> We have
> setAs("ANY", "integer64", function(from) as.integer64(from))
Sorry, but who is "we"?
R does not know about "integer64" nor an as.integer64()
I'd expect knowledgable posters to R-devel to use reproducible
examples, please !?
Martin
> I expected that would work to default as(x, "integer64")
> to use the S3 coercion, but not so for a different S3
> class:
> x = 1e10 class(x) = c("foo", "integer64") as(x,
> "integer64") # Error in as(x, "integer64") : # internal
> problem in as(): “foo” is(object, "integer64") is TRUE,
> but the metadata asserts that the 'is' relation is FALSE
....
More information about the R-devel
mailing list