Skip to contents

Some statistical agencies make a final revision of their data after a certain period of time in a give month in the year. This function extracts values from a given month or quarter a specified number of years after the initial release.

Usage

get_fixed_release(df, years, month = NULL, quarter = NULL)

Arguments

df

A data frame containing columns pub_date (publication date) and time (observation date).

years

The integer number of unrestricted years after pub_date for which the values should be extracted.

month

An optional parameter specifying the target month as a name ("July") or an integer (7). Cannot be used with quarter.

quarter

An optional parameter specifying the target quarter (1-4). Cannot be used with month.

Value

A filtered data frame containing values matching the specified criteria.

Examples

df <- dplyr::filter(reviser::gdp, id=="US")
dta <- get_fixed_release(df, month = "July", years = 3)
dta <- get_fixed_release(df, month = 7, years = 3)
dta <- get_fixed_release(df, quarter = 3, years = 3)