title: Inheritance of non-list based classes in R?
body: <p>In R inheritance can be implemented by extending a list based class the following way: 
  Assume <code>lmo</code> is a object of class <code>lm</code> obtained from linear model fitting. The class could simply be extended by:</p>
  
  <pre><code>x &lt;- rnorm(1000)
  y &lt;- rexp(1000)
  lmo &lt;- lm(x~y)
  
  lmo$addition &lt;- "some more information"
  class(lmo) &lt;- c("lmext","lm")
  </code></pre>
  
  <p>I could still use all methods like <code>summary.lm</code> that worked for <code>lm</code> but also defined custom methods. Obviously there are lots of situations in which you want to just have minimal additions and still want to be able to use all the methods from the parent class. </p>
  
  <p>What is the best way to add additional properties and implement method inheritance for classes that are not based on lists like e.g. time series? 
  Here's what I could imagine: </p>
  
  <pre><code>ts1 &lt;- ts(rnorm(100),start = c(1990,1),frequency = 4)
  attr(ts1,"additional") &lt;- "some more information"
  class(ts1) &lt;- c("tsext","ts")
  
  print.tsext &lt;- 
  # some method that uses the original print method for ts, plus extracts
  # the additional information
  </code></pre>
  
  <p>Is this a good way of achieving that operators like <code>+</code> etc. still work without redefining everything for the new class? Is there something better? And is there a way of keeping the additional class / attributes when for example adding two series to each other without redefining all the basic operators? </p>