title: How to convert continuous variable to discrete in R?
body: <p>I  have a variable which encodes group ID:</p>
  
  <pre><code>d &lt;- data.frame(group = c(0,1,0,2,1,3,2,0,1,2), x=c(1.2,2.3,3.2,2.1,1.3,1.5,2.3,0.4,1.3,1.7))
  </code></pre>
  
  <p>When I try to use it in ggplot2 for making boxplots I get an error </p>
  
  <blockquote>
    <p>Continuous value supplied to discrete scale</p>
  </blockquote>
  
  <p>At attempt to render data. Then I manually change at least one group ID in data to text everything works OK.</p>
  
  <p><strong>So, my question is:</strong> is where some easy way to change continuous variable, containing finite number of variants to discrete?</p>