title: Using oop in R, unable to understand the concept
body: <p>Its my first try to using OOP in R and it's difficult for me to understand the main concept. For example, what are these:</p>
  
  <pre><code>slot, setGeneric, representation
  </code></pre>
  
  <p>I was unable to find anything helpful by searching the internet. How do these work in R? For example, I have the following MATLAB class:</p>
  
  <pre><code>classdef windTurbine &lt; handle
  properties
      NumOfBlades  
      blade@blade 
      sweptArea
  end
  
  methods
      function obj = windTurbine(NumOfBlades,blade)
          obj.NumOfBlades = NumOfBlades;
          obj.blade = blade;
          obj.sweptArea = CalcSweptArea(obj);
      end
  
      sweptArea = CalcSweptArea(obj)
  end
  </code></pre>
  
  <p>How do I write this in R? How do I add calculations to the constructor? Make functions private? And mainly use the consept of OOP in R. An example would be helpfull, or a nice tutorial explanation</p>