title: What's the difference between integer class and numeric class in R
body: <p>I want to preface this by saying I'm an absolute programming beginner, so please excuse how basic this question is. </p>
  
  <p>I'm trying to get a better understanding of "atomic" classes in R and maybe this goes for classes in programming in general. I understand the difference between a character, logical, and complex data classes, but I'm struggling to find the fundamental difference between a numeric class and an integer class. </p>
  
  <p>Let's say I have a simple vector <code>x &lt;- c(4, 5, 6, 6)</code> of integers, it would make sense for this to be an integer class. But when I do <code>class(x)</code> I get <code>[1] "numeric"</code>. Then if I convert this vector to an integer class <code>x &lt;- as.integer(x)</code>. It return the same exact list of numbers except the class is different. </p>
  
  <p>My question is why is this the case, and why the default class for a set of integers is a numeric class, and what are the advantages and or disadvantages of having an integer set as numeric instead of integer. </p>