title: Use of "get" in dplyr
body: <p>The background to this is that I have some legacy code which uses plyr in a few places, and until a couple of days ago, plyr had not been updated to make it work with R 3.5.  I think that is a bit of a signal of diminishing support for plyr, hence I am looking into changing the plyr commands to dplyr.  The ddply commands in the legacy code involve some "get" commands to refer to columns whose names are contained in a variable.  A direct translation would involve code of the type below (a contrived example, but it shows the point).  It seems to work, and keeps it closest to the original code, but are there any pitfalls in doing this?  I get the impression it is not the manufacturer-approved way to program with dplyr!<br>
  Example code:</p>
  
  <pre><code>library("dplyr")
  testFunction &lt;- function(dataset, groupcol, varcol){
    summaryTable &lt;- dataset %&gt;% 
      group_by(get(groupcol)) %&gt;%
      summarise(mean_var = mean(get(varcol)),
                sd_var = sd(get(varcol)))
    return(summaryTable)
  }
  testGroup &lt;- "cyl"
  testVar &lt;- "mpg"
  testFunction(mtcars, testGroup, testVar)
  </code></pre>
  
  <p>Being a dinosaur, I am tempted by the alternative of translating from plyr back into base-R (with no "get"s in sight), e.g. something like:</p>
  
  <pre><code>fossilFunction &lt;- function(dataset, groupcol, varcol){
    z &lt;- by(dataset, dataset[ , testGroup], function(x){
      c(mean_var = mean(x[ , varcol]), 
        sd_var = sd(x[ , varcol]))
    })
    z &lt;- do.call(rbind, z)
    data.frame(rownames(z), z, row.names = NULL)
  }
  testGroup &lt;- "cyl"
  testVar &lt;- "mpg"
  fossilFunction(mtcars, testGroup, testVar)
  </code></pre>
  
  <p>Speed is not an issue in this case.  However, must try to look forwards, not back...</p>