title: Find out the item first time shows in a data set
body: <p>I have a data set ProductTable, I want to return the date of all the ProductsFamily has been ordered first time and the very last time. Examples:</p>
  
  <pre><code>ProductTable
   OrderPostingYear OrderPostingMonth OrderPostingDate ProductsFamily Sales QTY
  2008               1                       20          R1            5234   1
  2008               1                       12          R2            223    2
  2009               1                       30          R3            34     1 
  2008               2                       1           R1            1634   3
  2010               4                       23          R3            224    1 
  2009               3                       20          R1            5234   1
  2010               7                       12          R2            223    2
  </code></pre>
  
  <p>Result as followings</p>
  
  <pre><code>OrderTime
  ProductsFamily OrderStart OrderEnd      SumSales
  R1              2008/1/20  2009/3/20    12102
  R2              2008/1/12  2010/7/12    446
  R3              2009/1/30  2010/4/23    258
  </code></pre>
  
  <p>I have no idea how to do it. Any suggestions? </p>
  
  <pre><code>ProductTable &lt;- structure(list(OrderPostingYear = c(2008L, 2008L, 2009L, 2008L, 
  2010L, 2009L, 2010L), OrderPostingMonth = c(1L, 1L, 1L, 2L, 4L, 
  3L, 7L), OrderPostingDate = c(20L, 12L, 30L, 1L, 23L, 20L, 12L
  ), ProductsFamily = structure(c(1L, 2L, 3L, 1L, 3L, 1L, 2L), .Label = c("R1", 
  "R2", "R3"), class = "factor"), Sales = c(5234L, 223L, 34L, 1634L, 
  224L, 5234L, 223L), QTY = c(1L, 2L, 1L, 3L, 1L, 1L, 2L)), .Names = c("OrderPostingYear", 
  "OrderPostingMonth", "OrderPostingDate", "ProductsFamily", "Sales", 
  "QTY"), class = "data.frame", row.names = c(NA, -7L))
  </code></pre>