I have a set of data that I need to plot in ggplot2. It is time ordered. This is the data set:
testset <- data.table(Date=as.Date(c(\"2013-07-02\",\"2013-
You can use the yearmon
class from the zoo
package. There is a scale_..._yearmon
function in the zoo
package that works similarly to the scale_x_date
function in the scales
package
library(zoo)
ggplot(testset, aes(as.yearmon(Date), fill=Action)) +
geom_bar(position = position_dodge(width = 1/12),
binwidth=1/12, colour='black') +
scale_x_yearmon()