f.daily {tdata} | R Documentation |
Create a Daily Frequency
Description
Use this function to create a frequency for time-series data that occurs daily.
Usage
f.daily(date)
Arguments
date |
The date, which can be a list with |
Details
To use the as.frequency
function for this type of frequency,
you need the following information:
-
Character Format
"YYYYMMDD"
(similar toWeekly
) -
Class Id
"d"
Value
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 |
Examples
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
[Package tdata version 0.3.0 Index]