I have this code:
private$svg <- if(is(private$idaPlotObj, "DivosGridBmiPlot")){
...
} else {
...
}
in my code and I'm trying to refactor this code and get list of classes from private$idaPlotObj that is reference class, but all I get is this:
[1] "BMIDynamicRatiosPlot"
attr(,"package")
[1] "divosBMI"
when I'm using attr(private$idaPlotObj,"class") or class(private$idaPlotObj)
How can I get all class names from reference class? If I will have 4 classes I will need to check each one with is. I would like to compare vectors to test if class is on the list.
Here is what you could do for reference classes:
Example:
Now to obtain all the classes of
tri1we do:Edit
Putting everything together, you could do: