title: S4 Classes: Multiple types per slot
body: <p>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. </p>
  
  <pre><code>exampleClass &lt;- setClass("exampleClass",
      representation(raw=c("data.frame","numeric","character"),
      anotherSlot=c("data.frame","numeric")) 
  </code></pre>
  
  <p>Or, is this the type of situation where defining a sub-class / super-class becomes necessary? </p>
  
  <p>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. </p>