[ACCEPTED]-Sequence of time(hour)-sequence
Accepted answer
Specify the time in full?
seq(
from=as.POSIXct("2012-1-1 0:00", tz="UTC"),
to=as.POSIXct("2012-1-3 23:00", tz="UTC"),
by="hour"
)
0
You did not use a standard format for the 1 dates. See ?as.POSIXct
.
Try this
seq(from=as.POSIXct("2012-01-01 00:00:00", tz="UTC"),
to=as.POSIXct("2012-01-03 23:00:00", tz="UTC"), by="hour")
You could specify a format:
seq(
from=as.POSIXct("2012-1-1 0","%Y-%m-%d %H", tz="UTC"),
to=as.POSIXct("2012-1-3 23", "%Y-%m-%d %H", tz="UTC"),
by="hour"
)
0
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.