A couple of comments,
1. The problem is not actually in as() but in is():
> xx = Sys.time()
> is(xx, "OptionalPOSIXct")
[1] FALSE
> class(xx)
[1] "POSIXt" "POSIXct"
This is in fact, an "unintended" change, aka bug. Will be fixed shortly.
2. However, as the last line of the above should
Yes, there's a change from R 2.6.2 to 2.7.0 that might have
been unintended and hence a bug.
The short version is this
setClassUnion("OptionalPOSIXct", c("POSIXct", "NULL"))
as(Sys.time(), "OptionalPOSIXct", strict=FALSE)
which now gives
>> Error ..
>> no method or default for coe
Something has changed in the S4 default for coercing. Am I now suppose
to use setAs, or is there something else I should do to make this work:
R version 2.7.0 (2008-04-22)
> require("methods")
> setClassUnion("OptionalPOSIXct", c("POSIXct", "NULL"))
[1] "OptionalPOSIXct"
> setClass(