title: Unsupported use of matrix error using dplyr
body: <p>Lets I have data frame like this:</p>
  
  <pre><code>    df &lt;- structure(list(subjecttaxnoid = c("22661187010", "10346575807", 
  "22439110996", "63510438612", "85267957976", "40178118040", "51246665873", 
  "66803849969", "45813719599", "26979059418", "11240408751"), 
      reportyear = c(2014L, 2014L, 2014L, 2008L, 2008L, 2008L, 
      2008L, 2013L, 2013L, 2013L, 2013L), b001 = c(0, 0, 0, 0, 
      0, 0, 0, 0, 0, 0, 0), b002 = c(0, 3.43884233571018e-07, 7.24705810574303e-08, 
      1.41222784374111e-07, 1.62917712565032e-05, 0, 4.53310814208705e-07, 
      7.63856039195011e-06, 0, 0, 0)), .Names = c("subjecttaxnoid", 
  "reportyear", "b001", "b002"), row.names = c(1L, 2L, 3L, 200000L, 
  200001L, 200002L, 200003L, 40000L, 40001L, 40002L, 40003L), class = "data.frame")
  </code></pre>
  
  <p>and the vector that containt names of two columns of df:</p>
  
  <pre><code>x &lt;- c("b001", "b002")
  </code></pre>
  
  <p>I would like to use components of x instead of columns names in dplyr:</p>
  
  <pre><code>my_list &lt;- list()
  for (i in 1:length(x)){
    my_list[[1]] &lt;- df %&gt;% group_by(reportyear) %&gt;% top_n(2, wt = x[1])
  }
  </code></pre>
  
  <p>This returns an error:</p>
  
  <pre><code> Error in eval(substitute(expr), envir, enclos) : 
    Unsupported use of matrix or array for column indexing
  </code></pre>
  
  <p>Could you please help with this issue?</p>