title: Group ranges of numbers of a certain variable
body: <p>I want to group the values of a certain column in my data frame.</p>
  <p>Cluster 1: 1 to 249</p>
  <p>Cluster 2: 250 to 1499</p>
  <p>Cluster 3: &gt;= 1500</p>
  <p>Let's say I have a data frame containing 2 Variables (V1, V2):</p>
  <pre><code>V1 &lt;- c(1,5,25,100,200, 1000, 10000)
  V2 &lt;- c(1,2,3,2,5,9, 4)
  DF &lt;- data.frame(V1, V2)
  </code></pre>
  <p>which will result in:</p>
  <pre><code>     V1 V2
  1     1  1
  2     5  2
  3    25  3
  4   100  2
  5   200  5
  6  1000  9
  7 10000  4
  </code></pre>
  <p>so far I tried:</p>
  <pre><code>DF %&gt;% mutate(V1=recode(V1, `200`= 1))
  </code></pre>
  <p>which indeed recodes 200 to 1 (for Cluster 1), but I do not know how to apply this on a range of numbers (1 to 249, 250 to 1499 and everything equal and above 1500).</p>
  <p>Simply putting the numbers between a colon operator like:</p>
  <pre><code>DF %&gt;% mutate(V1=recode(V1, `1:249`= 1))
  </code></pre>
  <p>returns an error:</p>
  <blockquote>
  <p>Warning message:
  Problem with <code>mutate()</code> column <code>V1</code>.
  ℹ <code>V1 = recode(V1, </code>1:249<code> = 1)</code>.
  ℹ NAs introduced by coercion</p>
  </blockquote>
  <p>Is there a way to solve this?
  Thanks.</p>