xd0 <- f.x.times.a.day(f.daily(c(2023,5,16)),13, 12)
xd0_value_str <- as.character(xd0) # this will be '20230516:12'.
xd0_class_str <- get.class.id(xd0)
# this will be 'da13|d'. The second part (i.e., 'd')
# shows that this frequency is defined in a 'Daily' frequency.
xd_new <- as.frequency("20231101:3", "da3|i:wed-sat")
# Don't make the following mistakes:
# \donttest{
xd_invalid <- try(as.frequency("20231101:3", "da|i:wed-sat"))
# invalid format in day-based frequency
xd_invalid <- try(f.x.times.a.day(f.daily(c(2023,5,16)),4,0)) # invalid position
# }
Run the code above in your browser using DataLab