title: Group values that occur only once into an OTHER field
body: <p>I've got a collection of Roman Coins that I'm trying to represent using <code>ggplot</code> in R.  </p>
  
  <p>There are 25 different denominations in the data, but I'd like to merge together all denominations that only have one occurrence into an 'OTHER' field, so that the graphs are easier to read. </p>
  
  <pre><code>  Medium Method Denom            Date                  Era
  1 Silver Struck Denarius         112 B.C.E.:111 B.C.E. Period V – c. 119-91 B.C.E.
  2 Bronze   Cast Χαλκα μεγεθους   181 B.C.E.:174 B.C.E. Period III – c. 187-155 B.C.E.
  3 Bronze Struck Litra:Half-litra            269 B.C.E. Period I – 269 - c. 222 B.C.E.
  4 Bronze Struck Litra:Half-litra            269 B.C.E. Period I – 269 - c. 222 B.C.E.
  5 Silver Struck Didrachm         275 B.C.E.:270 B.C.E. Period I – 269 - c. 222 B.C.E.
  6 Bronze Struck Double-litra     275 B.C.E.:270 B.C.E. Period I – 269 - c. 222 B.C.E.
  </code></pre>
  
  <p>Using the data.frame sample above, the "Denom" column needs to have every value that occurs only one time grouped together and displayed as "other."  I think I should do this in the data before starting the plot. Please point me in the right direction.  </p>
  
  <p>Here's the code I'm using for <code>ggplot</code> if that helps.</p>
  
  <pre><code>ggplot(data=longbadian, aes(x=Era, fill=Denom)) 
  +    geom_bar(aes(x=Era2), data = longbadian, stat="bin") 
  + theme(axis.text.x =  element_text(angle=75, hjust=1), 
                         legend.title=element_blank()) 
  + xlab("Sydenham Periods") 
  + ylab("Coins by Denomination")
  </code></pre>
  
  <p>Here's an example graph:</p>
  
  <p><img src="https://i.stack.imgur.com/k8ILw.png" alt="enter image description here"></p>