title: R: Count unique values by category
body: <p>I have data in R that looks like this:</p>
  
  <pre><code> Cnty   Yr   Plt       Spp  DBH Ht Age
   1  185 1999 20001 Bitternut  8.0 54  47
   2  185 1999 20001 Bitternut  7.2 55  50
   3   31 1999 20001    Pignut  7.4 71  60
   4   31 1999 20001    Pignut 11.4 85 114
   5  189 1999 20001        WO 14.5 80  82
   6  189 1999 20001        WO 12.1 72  79
  </code></pre>
  
  <p>I would like to know the quantity of unique species (Spp) in each county (Cnty).  "unique(dfname$Spp)" gives me a total count of unique species in the data frame, but I would like it by county.</p>
  
  <p>Any help is appreciated!  Sorry for the weird formatting, this is my first ever question on SO.</p>
  
  <p>Thanks.</p>