title: Splitting a variable into equally sized groups
body: <p>I have a continuous variable called <code>Longitude</code> (it corresponds to geographical longitude) that has 12465 unique values. I need to create a new variable called <code>Longitude1024</code> that consists of the variable Longitude split into 1024 equally sized groups. I did that using the following function: </p>
  
  <pre><code>data$Longitude1024 &lt;- as.factor( as.numeric( cut(data$Longitude,1024)))
  </code></pre>
  
  <p>However, the problem is that, when I use this function to create the new variable <code>Longitude1024</code>, this new variable consists of only 651 unique elements rather than 1024. Does anyone know what the problem here is and how could I actually get the new variable with 1024 unique values? </p>
  
  <p>Thanks a lot</p>