bheavner / minidtools

A R package for working with BDDS minids
Other
1 stars 0 forks source link

add obsoleted minid class to deal with null slots #17

Closed bheavner closed 6 years ago

bheavner commented 6 years ago

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...

bheavner commented 6 years ago

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