문제

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

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

도움이 되었습니까?

해결책

Discover the class of a class definition (the class definition is itself an S4 class!)

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

and, with a little exploring, arrive at

names(cls@subclasses)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top