Returns Julian day counts, date/time atoms from a "timeDate" object,
and extracts month atoms from a "timeDate" object.
# S3 method for timeDate
julian(x, origin = timeDate("1970-01-01"),
units = c("auto", "secs", "mins", "hours", "days", "weeks"),
zone = NULL, FinCenter = NULL, ...)# S4 method for timeDate
atoms(x, ...)
# S3 method for timeDate
months(x, abbreviate = FALSE)
# S3 method for timeDate
weekdays(x, abbreviate = FALSE)
# S3 method for timeDate
quarters(x, abbreviate)
# S4 method for timeDate
$(x, name)
for julian, a difftime object;
for atoms, a data.frame with attribute "control"
containing the financial center of the input vector x. The
data frame has the following components:
year,
month,
day,
hour,
minute,
second;
for months, a numeric vector with attribute "control"
containing the financial center. (Note: this use is
deprecated, use $month instead.)
for the dollar method, the corresponding component as numeric vector.
an object of class "timeDate".
a length-one object inheriting from class "timeDate"
setting the origin for the julian counter.
a character string denoting the date/time units in which the results are desired.
the time zone or financial center where the data were recorded.
a character string with the location of the financial center named as "continent/city".
currently not used.
one of year, month, day, hour,
minute, second, wday (or weekday),
wday0 (or weekday0), and
quarter. Completion is available in interactive sessions.
arguments passed to other methods.
Generic functions to extract properties of "timeDate"
objects. julian and months are generics from base R,
while atoms is a generic defined in this package.
julian extracts the number of days since origin (can be
fractional), see also julian.
atoms extracts the calendar atoms from a "timeDate"
object, i.e., the year, month, day, and optionally, hour, minute and
second. The result is a data frame with the financial center in
atrribute "control".
months extracts the months, see section ‘Note’.
The dollar operator applied to a "timeDate" object,
e.g. td$name, extracts a component of the date/time values as a
numeric vector. Currently, name can be one of year,
month, day, hour, minute, second,
wday (or weekday), wday0 (or weekday0),
and quarter. wday0 (weekday0) starts with 0 (for
Sunday), the meaning of the rest should be clear.
In interactive sessions, completion is available for the dollar operator.
## julian
tC = timeCalendar(2022)
julian(tC)[1:3]
## atoms
atoms(tC)
## months
months(tC)
weekdays(tC)
weekdays(tC, TRUE)
## the dollar method
tC$year
tC$month
tC$day
tC$hour
tC$minute
tC$second
tC$weekday
tC$weekday0
tC$quarter
Run the code above in your browser using DataLab