f.list.date | R Documentation |
List-Date
FrequencyUse 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.
f.list.date(items, value = NULL, reformat = TRUE)
items |
The items in the list in |
value |
The current value in |
reformat |
If the elements of |
In order to use the as.frequency
function for this type of frequency,
you need the following information:
Character Format: "YYYYMMDD"
(i.e., the item
)
Class Id: Ld
or Ld:...
(where '...' represents the semi-colon-separated items
)
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 |
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"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.