get_first_release: Extract the First Data Release (Vintage)

View source: R/revisions.R

get_first_releaseR Documentation

Extract the First Data Release (Vintage)

Description

Filters the input dataset to return the earliest release (or vintage) for each time period.

Usage

get_first_release(df, diagonal = FALSE)

Arguments

df

A data frame containing data vintages. The data frame must include the columns pub_date (publication date of the release) and time (the corresponding time period for the data).

diagonal

Logical. If TRUE, the function only returns real first releases.

Details

For each time period, the function identifies the release with the earliest publication date (pub_date). A new column release is added and labels all rows in the resulting data frame as release_0. If diagonal is set to TRUE, the function only returns the real first releases. That is historic values for which no vintages exist are not returned.

Value

A filtered data frame containing only the first release(s). The resulting data frame is assigned the class tbl_release to indicate its structure.

See Also

Other revision utilities: get_days_to_release(), get_fixed_release(), get_latest_release(), get_nth_release(), get_releases_by_date(), get_revisions()

Examples

# Example data
df <- dplyr::filter(reviser::gdp, id == "US")

# Get the first release for each time period
first_release <- get_first_release(df)


reviser documentation built on Sept. 14, 2026, 9:09 a.m.