get_latest_release: Extract the Latest Data Release (Vintage)

View source: R/revisions.R

get_latest_releaseR Documentation

Extract the Latest Data Release (Vintage)

Description

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

Usage

get_latest_release(df)

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

Details

For each time period, the function identifies the release with the latest publication date (pub_date) and adds a column release that labels the release as release_N, where N is the release index (zero indexed).

Value

A filtered data frame containing only the most recent 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_first_release(), get_fixed_release(), get_nth_release(), get_releases_by_date(), get_revisions()

Examples

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

# Get the latest release for each time period
latest_release <- get_latest_release(df)


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