bheavner/minidtools

add obsoleted minid class to deal with null slots

Closed this issue · 1 comments

see https://stackoverflow.com/questions/8334796/efficient-way-to-define-a-class-with-multiple-optionally-empty-slots-in-s4-of-r

When I attempt to resolve a minid with current lookup(), I get errors:

Error in validObject(.Object) : 
  invalid class “minid” object: 1: invalid object for slot "obsoleted_by" in class "minid": got class "character", should be or extend class "list"
invalid class “minid” object: 2: invalid object for slot "content_key" in class "minid": got class "NULL", should be or extend class "character"

thought: make an obsoleted class (or superclass?) for the null situation...

No. Better to just give default values to all slots in the constructor.