I was trying to use ggplot to plot monthly data that looks like this
count date
6 Oct 2010
23 Nov 2010
20 Dec 2010
16 Jan 2011
64 Oct 2011
...
425 Jul 2012
436 Aug 2012
405 Sep 2012
where date is of yearmon class from the zoo package.
This was my call:
ggplot(data, aes(x=date, y=count))+geom_line()
and this error came up: Error: Discrete value supplied to continuous scale.
So ggplot doesn't support the yearmon class, which is fine.
Then I tried to convert yearmon to Date. Now the data looks like this:
count date
6 2010-10-01
23 2010-11-01
20 2010-12-01
16 2011-01-01
64 2011-10-01
...
425 2012-07-01
436 2012-08-01
405 2012-09-01
and I made the same call, and this was the resulting plot (sorry about the href... new users aren't allowed to post images)
There is a drop at the end of the plot that shouldn't be there, because data$count had the similar values on the last few rows.
Does anyone have a good solution to this?
Thanks for reading,
Bill
