f.yearly {tdata}R Documentation

Create an Annual Frequency

Description

Use this function to create a frequency for time-series data that occurs annually.

Usage

f.yearly(year)

Arguments

year

An integer representing the year of the observation.

Details

In order to use the as.frequency function for this type of frequency, you need the following information:

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 year.

Examples


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.


[Package tdata version 0.3.0 Index]