title: Subset R data frame contingent on the value of duplicate variables
body: <p>How can I subset the following example data frame to only return one 
  observation for the earliest occurance [i.e. min(year)] of each id?</p>
  
  <pre><code>id &lt;- c("A", "A", "C", "D", "E", "F")
  year &lt;- c(2000, 2001, 2001, 2002, 2003, 2004)
  qty  &lt;- c(100, 300, 100, 200, 100, 500)
  df=data.frame(year, qty, id)
  </code></pre>
  
  <p>In the example above there are two observations for the "A" id at years 2000 and 2001.  In the case of duplicate id's, I would like the subset data frame to only include the the first occurance (i.e. at 2000) of the observations for the duplicate id.</p>
  
  <pre><code>df2 = subset(df, ???)
  </code></pre>
  
  <p>This is what I am trying to return:</p>
  
  <pre><code>df2
  
  year qty id
  2000 100  A
  2001 100  C
  2002 200  D
  2003 100  E
  2004 500  F
  </code></pre>
  
  <p>Any assistance would be greatly appreciated.</p>