f.daily | R Documentation |
Use this function to create a frequency for time-series data that occurs daily.
f.daily(date)
date |
The date, which can be a list with |
To use the as.frequency
function for this type of frequency,
you need the following information:
Character Format "YYYYMMDD"
(similar to Weekly
)
Class Id "d"
An object of class ldtf
, which is also a list with the following members:
class |
Determines the class of this frequency. |
year |
Determines the |
month |
Determines the |
day |
Determines the |
d0 <- f.daily(c(2023, 1, 2)) # This is 2/1/2023. Next observation belongs to 3/1/2023.
d0_value_str <- as.character(d0) # this will be '20230102'.
d0_class_str <- get.class.id(d0) # this will be 'd'.
d_new <- as.frequency("20230109", "d") # This is 9/1/2023.
# Don't use invalid or unsupported dates:
# d_invalid <- try(as.frequency("1399109", "d")) # this is a too old date and unsupported
# d_invalid <- try(as.frequency("20230132", "d")) # invalid day in month
d_invalid <- try(as.frequency("20231331", "d")) # invalid month
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.