timegrid | R Documentation |
Build an equally-spaced sequence of POSIXct timestamps.
timegrid(from, to, interval,
exclude.weekends = TRUE, holidays = NULL,
fromHHMMSS = "080000", toHHMMSS = "220000")
from |
a vector of length one that inherits from class
|
to |
a vector of length one that inherits from class |
interval |
A character string like “ |
exclude.weekends |
logical; default is |
fromHHMMSS |
A character vector of length one like
“ |
toHHMMSS |
A character vector of length one like
“ |
holidays |
A vector of class |
timegrid
creates an equally-spaced grid of class POSIXct
.
a vector of class POSIXct
(or a character vector of
length zero, in case no valid points remain)
Enrico Schumann
B.D. Ripley and K. Hornik. Date-Time Classes. R-News, 1(2):8–12, 2001.
strftime
, date
from <- as.POSIXct("2012-04-30 08:00:00")
to <- as.POSIXct("2012-05-04 22:00:00")
timegrid(from, to, interval = "1 hour",
holidays = as.Date("2012-05-01"))
timegrid(as.POSIXct("2017-06-23 21:00:00"), ## system timezone
as.POSIXct("2017-06-26 10:00:00"),
interval = "15 min")
timegrid(as.POSIXlt("2017-06-23 21:00:00", tz = "UTC"),
as.POSIXlt("2017-06-26 10:00:00", tz = "UTC"),
interval = "15 min")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.