Re: [Rd] R 2.6.0 S4 data breakage, R _data_class(), class<-, etc.

From: Martin Morgan <mtmorgan_at_fhcrc.org>
Date: Mon, 08 Oct 2007 06:59:17 -0700

bhs2_at_mevik.net (Bjørn-Helge Mevik) writes:

> Martin Morgan wrote:
>
>> But both 'new' and 'as' appear to produce invalid (in a different
>> sense, I guess) objects:
>>
>>> setClass("snp", contains="raw",
>> + validity=function(object) {
>> + if (length(object) < 1) "too short"
>> + else TRUE
>> + })
>
> Well, you _have_ designed a class with an invalid prototype (as
> determined by your own validity function). :-)

Yeah, its true I did, but the software let me get away with it. Even with a valid protoytpe I can as(raw(), "snp").

Martin

> --
> Bjørn-Helge Mevik
>
> ______________________________________________
> R-devel_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Mon 08 Oct 2007 - 14:01:17 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 25 Oct 2007 - 11:37:10 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.