How to get a list of classes that have a common superclass S4 in R

In R, how do I get a list of a subclass of an S4 superclass?

I found showClass ("mySuperClass", complete = FALSE), but it only prints the result. I would like to save it in a vector to use it.

+6
source share
1 answer

Open the class definition class (the class definition is itself an S4 class!)

cls = getClass("MySuperClass") class(cls) class?classRepresentation 

and, with a little study, come to

 names( cls@subclasses ) 
+6
source

Source: https://habr.com/ru/post/906083/


All Articles