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

Martin Morgan mtmorgan at fhcrc.org
Mon Oct 8 15:59:17 CEST 2007


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



More information about the R-devel mailing list