title: Using dplyr, how to pipe or chain to plot()?
body: <p>I am new to dplyr() package and trying to use it for my visualization assignment. I am able to pipe my data to <strong>ggplot()</strong> but unable to do that with <strong>plot()</strong>. I came across <a href="https://stackoverflow.com/questions/25467992/how-to-use-chaining-in-dplyr-to-access-internal-variables">this post</a> and the answers including the one in comments, didn't work for me. </p>
  
  <p>Code 1:</p>
  
  <pre><code>emission &lt;- mynei %&gt;%
      select(Emissions, year) %&gt;%
      group_by(year) %&gt;%
      summarise (total=sum(Emissions))
  
  emission %&gt;%
      plot(year, total,.)
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>Error in plot(year, total, emission) : object 'year' not found
  </code></pre>
  
  <p>Code 2:</p>
  
  <pre><code>mynei %&gt;%
      select(Emissions, year) %&gt;%
      group_by(year) %&gt;%
      summarise (total=sum(Emissions))%&gt;%
      plot(year, total, .)
  </code></pre>
  
  <p>This didn't work either and returned the same error. </p>
  
  <p>Interestingly, the solution from the post I mentioned works for the same dataset but doesn't work out for my own data. However, I am able to create the plot using <strong>emission$year</strong> and <strong>emission$total</strong>. </p>
  
  <p>Am I missing anything?</p>