f.yearly: Create an Annual Frequency

View source: R/frequency.R

f.yearlyR 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:

  • Character Format "#" (the number is the year)

  • Class Id "y"

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.


tdata documentation built on Nov. 7, 2023, 5:07 p.m.