timeSequence | R Documentation |
Create a regularly spaced object of class "timeDate"
.
timeSequence(from, to = Sys.timeDate(), by, length.out = NULL,
format = NULL, zone = "", FinCenter = "")
## S3 method for class 'timeDate'
seq(from, to, by, length.out = NULL, along.with = NULL, ...)
from , to |
starting date, required, and end date, optional. If supplied,
|
by |
|
length.out |
integer, optional. Desired length of the sequence, if specified "to" will be ignored. |
along.with |
Take the length from the length of this argument. |
format |
the format specification of the input character vector. |
zone |
the time zone or financial center where the data were recorded. |
FinCenter |
a character with the location of the financial center named as "continent/city". |
... |
arguments passed to other methods. |
an object of class "timeDate"
timeSequence()
is a wrapper for the "timeDate"
method of
seq()
, and that has been closely modeled after base R's
POSIXt
method, seq.POSIXt
.
## timeSequence
## autodetection of format
(t1 <- timeSequence(from = "2004-03-12", to = "2004-04-11"))
stopifnot( ## different formats even:
identical(t1, timeSequence(from = "2004-03-12", to = "11-Apr-2004")),
identical(t1, ## explicit format and FinCenter :
timeSequence(from = "2004-03-12", to = "2004-04-11",
format = "%Y-%m-%d", FinCenter = "GMT")))
## observe "switch to summer time":
timeSequence(from = "2004-03-26 05:00:00", to = "2004-04-02 05:00:00",
zone = "Europe/Zurich", FinCenter = "Europe/Zurich")
## ensure fixed clock time:
timeSequence(from = "2004-03-26 05:00:00", to = "2004-04-01 05:00:00",
by = "DSTday", zone = "Europe/Zurich", FinCenter = "Europe/Zurich")
## on the day of DST change the time may not exist (notice 2004-03-28 00:00:00):
timeSequence(from = "2004-03-26 01:00:00", to = "2004-04-01 01:00:00",
by = "DSTday", zone = "Europe/Zurich", FinCenter = "Europe/Zurich")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.