f.list.date {tdata} | R Documentation |
Create a List-Date
Frequency
Description
Use this frequency for data with date labels. It is generally a list of dates, but it can also be used to label observations outside this list.
Usage
f.list.date(items, value = NULL, reformat = TRUE)
Arguments
items |
The items in the list in |
value |
The current value in |
reformat |
If the elements of |
Details
In order to use the as.frequency
function for this type of frequency,
you need the following information:
-
Character Format:
"YYYYMMDD"
(i.e., theitem
) -
Class Id:
Ld
orLd:...
(where '...' represents the semi-colon-separateditems
)
Value
An object of class ldtf
. It is also a list with the following members:
class |
Determines the class of this frequency. |
items |
Determines the |
value |
Determines the |
Examples
Ld0 <- f.list.date(c("20231101","20220903","20200823","20230303"), "20200823")
Ld0_value_str <- as.character(Ld0) # this will be '20200823'.
Ld0_class_str <- get.class.id(Ld0)
# this will be 'Ld:20231101;20220903;20200823;20230303'.
Ld_new <- as.frequency("20231101", "Ld:20231101;20220903;20200823;20230303")
Ld_new0 <- as.frequency("20231101", "Ld")
# compared to the previous one, its items will be empty
# Don't make the following mistakes:
Ld_invalid <- try(as.frequency("20231102", "Ld:20231101;20220903;20200823;20230303"))
# 'E' is not a member of the list
Ld_invalid <- try(f.list.date(c("20231101","20220903","20200823","20230303"), "20231102"))
[Package tdata version 0.3.0 Index]