hughjonesd / rcheology

Data on Base Packages for Previous Versions of R
https://hughjonesd.shinyapps.io/rcheology
Creative Commons Zero v1.0 Universal
39 stars 2 forks source link

More metadata for routines and S3 methods #13

Open MichaelChirico opened 10 months ago

MichaelChirico commented 10 months ago

It's not particularly interesting in most cases to follow "virtual" objects like .__C__(:

subset(rcheology, startsWith(name, ".__"))

It would be nice to have a metadata column to exclude those "officially" rather than using regex to do so, perhaps unreliably.

It would also be nice to have S3 methods like $.data.frame tagged as such. Mostly, such objects are not called directly in user code, and some use cases wouldn't care if new methods are added to existing S3 generics.

Moreover, it is basically impossible to correctly exclude these objects on your own, because e.g. $.data.frame was removed after 3.5.3, so looking at methods("$") in a more recent version of R will not find it. Looking for startsWith(name, "$.") probably works for $ but I'm not sure about S3 generics generally.

hughjonesd commented 10 months ago

This sounds good. I'd accept a patch.

hughjonesd commented 10 months ago

The help for ls says that all.names=TRUE simply includes anything that starts with a dot .. Is there anything else to check?

hughjonesd commented 10 months ago

Another issue: I can call methods(generic) but how do I know which things are generics? utils::isS3stdGeneric only exists in 3.4.0 and beyond.

Option 1: backport it.

Option 2: use methods(class=...) for a fixed set of classes. (But which?)

hughjonesd commented 10 months ago

Note the new column "hidden" in 4.3.2.0.