I tried:
seq(
from=as.POSIXct("2012-1-1 0", tz="UTC"),
to=as.POSIXct("2012-1-3 23", tz="UTC"),
by="hour"
)
But I only get 1 hour(0:00:00) of the last day instead of 24 hours, actually any hour of the day resulted in only one hour(0:00:00), and I do want to have 2012-1-4.
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"
)
You did not use a standard format for the 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")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With