I am working with a data frame where one of the columns consists of POSIXct
date-time values. I am trying to plot a histogram of these timestamps using ggplot2
but I'm having two issues:
I don't know how to set the binwidth in
geom_histogram()
. I'd like to set each bin to a day or a week. I've tried providing a difftime object, but I get an error. I also triedbinwidth=1
but R just hangs.How do I set the limits in
scale_x_time()
? The only way I could get it to work was by converting myPOSIXct
timestamps usingas.Date()
.