title: Using case_when i r dplyr with OR
body: <p>I have in my data this column :</p>
  <pre><code>table(data$year)
  2011 2012 2013 2014 2015 2016 2017 2018 2019 
     2   28   17   36   26   29   37   33   10
  
  is.numeric(data$year)
  [1] TRUE
  </code></pre>
  <p>I want to mutate with case_when with the following code :</p>
  <pre><code>data &lt;- data %&gt;%
    mutate(periode_2a = case_when(
      year &gt;= 2011 &amp;&amp; year &lt;= 2013  ~ &quot;2011-2013&quot;,
      year &gt;= 2014 &amp;&amp; year &lt;= 2015 ~ &quot;2014-2015&quot;,
      year &gt;= 2016 &amp;&amp; year &lt;= 2017 ~ &quot;2013-2017&quot;,
      TRUE ~ &quot;2018-2019&quot;
    ))
  </code></pre>
  <p>Which i think is obvious : i want to make category of years.</p>
  <p>I obtain that :</p>
  <pre><code>table(data$periode_2a)
  
  2011-2013 
        218 
  </code></pre>
  <p>I have try some other style :</p>
  <pre><code>&gt; data &lt;- data %&gt;%
  +   mutate(periode_2a = case_when(
  +     year == 2011:2013 ~ &quot;2011-2013&quot;,
  +     year == 2014:2015 ~ &quot;2014-2015&quot;,
  +     year == 2016:2017 ~ &quot;2013-2017&quot;,
  +     TRUE ~ &quot;2018-2019&quot;
  +   ))
  </code></pre>
  <p>or</p>
  <pre><code>&gt; data &lt;- data %&gt;%
  +   mutate(periode_2a = case_when(
  +     year == &quot;2011&quot;|&quot;2012&quot;|&quot;2013&quot; ~ &quot;2011-2013&quot;,
  +     year == &quot;2014&quot;|&quot;2015&quot; ~ &quot;2014-2015&quot;,
  +     year == &quot;2016&quot;|&quot;2017&quot; ~ &quot;2013-2017&quot;,
  +     TRUE ~ &quot;2018-2019&quot;
  +   ))
  </code></pre>
  <p>without success ...</p>
  <p>What did i wrong ??</p>
  <p>Thanks to all</p>