f.yearly | R Documentation |
Use this function to create a frequency for time-series data that occurs annually.
f.yearly(year)
year |
An integer representing the year of the observation. |
In order to use the as.frequency
function for this type of frequency,
you need the following information:
Character Format "#"
(the number is the year
)
Class Id "y"
An object of class ldtf
which is also a list with the following members:
class |
Determines the class of this frequency. |
year |
Determines the |
y0 <- f.yearly(2020) # this initializes a 'yearly' frequency
y0_value_str <- as.character(y0) # this will be '2020'.
y0_class_str <- get.class.id(y0) # this will be 'y'.
y_new <- as.frequency("2021", "y") # this is a yearly frequency. It points to year 2021.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.