Is it possible to create an S4 class, where one or more of the slots can be of multiple classes? For example. Let's say that you had a situation where data could be either a vector, or a data.frame.
exampleClass <- setClass("exampleClass",
representation(raw=c("data.frame","numeric","character"),
anotherSlot=c("data.frame","numeric"))
Or, is this the type of situation where defining a sub-class / super-class becomes necessary?
PS: Searching for a useful tutorial on S4 classes produces limited results. Links to a good tutorial on S4 class creation/usage/documentation would be greatly appreciated.