title: Trouble with creating new variable based on mean in R
body: <p><a href="https://i.stack.imgur.com/0NpxH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0NpxH.png" alt="enter image description here" /></a></p>
  <p>I have the following data and I am trying to get the mean duration (dur)</p>
  <pre><code>atusJoin3 %&gt;%
      group_by(tuyear, agegroup) %&gt;% 
      summarise(mean_dur = mean(dur, na.rm = T))
  </code></pre>
  <p><a href="https://i.stack.imgur.com/G6nzs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/G6nzs.png" alt="enter image description here" /></a></p>
  <p>However, when I try to use the mean_dur in ggplot, it says that mean_dur is not found. Any idea, why mean_dur cannot be found?</p>