In a previous version of ggplot2, I was able to use one of the following two commands to format my x dates: Either
scale_x_date(breaks = "1 month", minor_breaks = "1 week", labels=(date_format="%B")) +
or
scale_x_date(major="months", minor="weeks", format="%B") +
to create the format "% B", the full name of the month.
(I'm afraid I can no longer tell which one worked because they were both commented out.)
I donโt remember when, but after updating R or ggplot in the ubuntu 12.04 update, this no longer worked for me. Now the same data causes an error:
Error in scale_labels.continuous(scale) : Breaks and labels are different lengths
With the first and
Error in continuous_scale(aesthetics, "date", identity, breaks = breaks, : unused argument(s) (major = "months", minor = "weeks", format = "%B")
With the second.
If I remove the label = arguments and apply
scale_x_date(breaks = "1 month", minor_breaks = "1 week") +
it forms the date format "YYYY-MM-DD" on the first of each month.
Counseling using a feature? scale_x_date, I also tried the following:
scale_x_date(breaks = "1 month", minor_breaks = "1 week", labels=date_format("%B")) +
But this causes this error:
Error in structure(list(call = match.call(), aesthetics = aesthetics, : could not find function "date_format"
How do I get the month format "% B" on my x axis? (If you have more information about the mechanism that generates these error messages, I would also appreciate it.)