I would put the vector of times into a column of a data.frame. The example data below has a thousand timestamps with a random time between the current time and two year from now.
dat = data.frame(timestamp = Sys.time() + sort(round(runif(1000, (24*3600), (2*365*24*3600)))))
Next step is to create a new column that identifies which month and year the timestamp is in:
dat$month = strftime(dat$time, "%b")
dat$year = strftime(dat$time, "%Y")
Now we can count the timestamps per month for each year using count
from the plyr
package.
library(plyr)
timestamps_month = count(dat, vars = c("month","year"))
And create the histogram with ggplot2:
library(ggplot2)
ggplot(data = timestamps_month) + geom_bar(aes(x = month, y = freq, fill = year), stat="identity", position = "dodge")
See this SO post for an example of how the resulting plot looks like:
How to create histogram in R with CSV time data?