title: Format ggplot2 axis labels such that only numbers > 9999 have commas
body: <p>I'm trying to adhere to a publication style guide whereby only numbers with 5 or more digits have commas. Have searched this but not found a way to override the defaults when using 'labels=comma.' Below is an example: </p>
  
  <pre><code> require(dplyr)
   require(ggplot2)
   require(scales)
  
   # create mock dataframe
   temp &lt;- mpg %&gt;% mutate(newvar=(hwy*300))
  
   ggplot(temp, aes(x=cyl, y=newvar)) + geom_point() +
   scale_y_continuous(labels=comma) +
   labs(title="When using 'labels=comma'...", 
        subtitle="How format axis labels such that commas only appear for numbers &gt; 9999?")
  </code></pre>
  
  <p>Using this example, would like the lowermost y-axis labels to read "4000", "6000" etc. Could achieve this manually but that's not worth the bother, as have many graphs with scales encompassing this range. Any suggestions?</p>