0

I'm currently attempting to plot with ggplot2 the number of occurrences (count) of dates by month in a data set that only contains dates in the month of August and September over a decade. It currently looks like such

enter image description here

How do I get the histogram to stop leaving gaps for months other than August and September? For example, I want my x-axis to contain the counts for dates in the following order: August 2001, September 2001, August 2002, September 2002, August 2003, September 2003... August 2017, September 2017.

d.b
  • 32,245
  • 6
  • 36
  • 77
andrew
  • 19
  • 1
  • 1
    You probably shouldn't treat your dates column as dates but as factors – dylanjm Feb 25 '19 at 23:26
  • Could you provide an example? I'm new to R and not sure how to do that. – andrew Feb 26 '19 at 17:41
  • If you can edit your post to be a reproducible example with a sample of your code using `dput()` then it would be a lot easier to help you. [Look here if you're not familiar with what a reproducible example is](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) – dylanjm Feb 26 '19 at 17:42

0 Answers0