I am getting an error using ggplot and I'm not sure how to fix it. I'm using data that looks like this:
Date sent.mean
1 14-03-01 3.000000
2 14-03-03 1.600000
3 14-03-04 3.000000
4 14-03-05 1.142857
5 14-03-06 2.625000
6 14-03-07 2.083333
The code I'm using to generate to generate the daily graph is:
ggplot(date.mean, aes(Date, sent.mean)) + geom_line() +
scale_x_date(format = "%b-%Y") + xlab("") + ylab("Average Sentiment")
The error I am getting is:
Error in scale_x_date(format = "%b-%Y") : unused argument (format = "%b-%Y")
Any help is greatly appreciated!
format
, butdate_labels
. So you prly wantscale_x_date(date_labels = "%b-%Y")
– lukeADate
column is recognized of type Date by R - I guess it's of type character of factor right now. To tell, you needed to provide a reproducible example ready to copy-paste-run. – lukeA