I have got a series of video uploads and I want to show how many videos has been uploaded in the last month, half year, year, 2, year, 3, year ...
PUBLISHED_AT
is of type posixct
and should be transformed into factor
with the levels above.
Is there a nice way to do so? Seems like I am not the first person thinking about something like this.
The dates are like:
Date<- as.POSIXct(c("2015-12-11 00:00:01", "2016-01-11 00:00:01", "2014-01-11 00:00:01", "2015-12-11 00:00:01", "2016-04-04 08:22:01", "2013-12-11 00:00:01")
, format= "%Y-%m-%d %H:%M:%S")
DF<- data.frame(Date,
Number=ceiling(abs(rnorm(1:6))))
I thought about using the cut
-Function but i don't know how to specify the breaks