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:
# \donttest{
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"))
# }
Run the code above in your browser using DataLab