[Rd] Is it possible to simply the use of NULL slots (or at least improve the help files)?

Abby Spurdle @purd|e@@ @end|ng |rom gm@||@com
Wed Sep 23 23:18:53 CEST 2020


As far as I can tell, there's no trivial way to set arbitrary S4 slots to NULL.

Most of the online examples I can find, use setClassUnion and are
about 10 years old.
Which, in my opinion, is defective.
There's nothing "robust" about making something that should be
trivially simple, really complicated.

Maybe there is a simpler way, and I just haven't worked it out, yet.
But either way, could the documentation for the methods package be improved?
I can find any obvious info on NULL slots:

Introduction
Classes
Classes_Details
setClass
slot

Again, maybe I missed it.
Even setClassUnion, which is what's used in the online examples,
doesn't contain a NULL slot example.

One more thing:
The help file for setClassUnion, uses the term "superclass", incorrectly.

Its examples include the following:
setClassUnion("maybeNumber", c("numeric", "logical"))

If maybeNumber was the superclass of numeric, then every instance of
numeric would also be an instance of maybeNumber...



More information about the R-devel mailing list