title: Difference between class() and typeof() in R?
body: <p>Both <code>class()</code> and <code>typeof()</code> appear to return very similar outputs on some vectors and lists.</p>
  <p><code>?typeof</code>:</p>
  <blockquote>
  <p>typeof determines the (R internal) type or storage mode of any object</p>
  </blockquote>
  <p>and <code>?class</code></p>
  <blockquote>
  <p>R possesses a simple generic function mechanism which can be used for an object-oriented style of programming. Method dispatch takes place based on the class of the first argument to the generic function.</p>
  </blockquote>
  <p>In practice, what are the differences between the two?</p>