title: Error in Weighted.Mean. Why can't it find column?
body: <p>I have a dataframe that looks like this</p>
  <pre><code>df &lt;- data.frame(Region = c(&quot;Asia&quot;,&quot;Asia&quot;,&quot;Africa&quot;,&quot;Europe&quot;,&quot;Europe&quot;),
  Emp = c(120,40,10,67,110),
  Sales18 = c(12310, 4510, 1140, 5310, 16435),
  Sales19 = c(15670, 6730, 1605, 6120, 1755))
  </code></pre>
  <p>I am running a code where I group by region and then take average and weighted average for all 'sales' columns by 'Emp'</p>
  <pre><code>Result &lt;- df %&gt;% group_by(Region) %&gt;% 
  summarise(sales18 = mean(Sales18, na.rm = T),
  sales19 = mean(Sales19, na.rm = T),
  weightedsales18 = weighted.mean(Sales18, .data[[Emp]], na.rm = T),
  weightedsales19 = weighted.mean(Sales19, .data[[Emp]], na.rm = T))
  </code></pre>
  <p>However, I get the following err</p>
  <pre><code>Error in splice(dot_call(capture_dots, frame_env = frame_env, named = named,  : 
    object 'Emp' not found
  </code></pre>
  <p>Can't figure out what I am doing wrong</p>