<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/programming-with-dplyr-by-using-dplyr/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://www.enchufa2.es/archives/programming-with-dplyr-by-using-dplyr.html"> R – Enchufa2</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>The title may seem tautological, but since the arrival of <code>dplyr</code> 0.7.x, there have been some efforts at <em>using <code>dplyr</code> without actually using it</em> that I can’t quite understand. The <code>tidyverse</code> has raised passions, for and against it, for some time already. There are excellent alternatives out there, and I myself use them when I find it suitable. But when I choose to use <code>dplyr</code>, I find it most versatile, and I see no advantage in adding yet another layer that complicates things and makes problems even harder to debug.</p>
<p>Take the example of <a rel="nofollow" href="http://www.win-vector.com/blog/2017/07/dplyr-0-7-made-simpler/" target="_blank"><code>seplyr</code></a>. It stands for <em>standard evaluation <code>dplyr</code></em>, and enables us to program over <code>dplyr</code> without having “to bring in (or study) any deep-theory or heavy-weight tools such as <code>rlang</code>/<code>tidyeval</code>”. Let’s consider the following interactive pipeline:</p>
<pre><code><span>library</span><span>(</span><span>dplyr</span><span>)</span>

<span>starwars</span> <span>%>%</span>
  <span>group_by</span><span>(</span><span>homeworld</span><span>)</span> <span>%>%</span>
  <span>summarise</span><span>(</span><span>mean_height</span> <span>=</span> <span>mean</span><span>(</span><span>height</span>, <span>na.rm</span> <span>=</span> <span>TRUE</span><span>)</span>,
            <span>mean_mass</span> <span>=</span> <span>mean</span><span>(</span><span>mass</span>, <span>na.rm</span> <span>=</span> <span>TRUE</span><span>)</span>,
            <span>count</span> <span>=</span> <span>n</span><span>(</span><span>)</span><span>)</span></code></pre>
<pre><code>## # A tibble: 49 x 4
##         homeworld mean_height mean_mass count
##             </code></pre>