title: Presentation of a longitudinal dataframe, counting by year
body: <p>I'm hoping one of you can help me, with this probably easy question. The thing is, I have a longitudinal dataframe, that looks something like this:</p>
  <pre><code>id &lt;- c('1','1','1','2','2','2','3','3','3')
  year &lt;- c(2012, 2013, 2014, 2012, 2013, 2014, 2012, 2013, 2014)
  ue &lt;- c(1, 0, 0, 1, 1, 0, 1, 1, 1)
  mydata &lt;- data.frame(id, year, ue)
  </code></pre>
  <p>The <code>ue</code> variable indicates whether a respondent received an unemployment benefit in a given year.</p>
  <ol>
  <li>First I want to create a simple table which tells me how many are receiving a ue-benefit in the specific year. Something like this:</li>
  </ol>
  <pre><code>  year ue
  1 2012  3
  2 2013  2
  3 2014  1
  </code></pre>
  <ol start="2">
  <li>I want to present the following table in an appropriate plot - ex a histogram.</li>
  </ol>
  <p>I hope some of you can help you.</p>
  <p>Thanks in advance.</p>