tidyr::gather
for year-like columns and convert them to integersR/pipeline-helpers.R
gather_years.Rd
Helper function: call tidyr::gather
for year-like columns and convert them to integers
gather_years(
d,
value_col = "value",
year_pattern = YEAR_PATTERN,
na.rm = FALSE
)
Data frame to operate on (a tibble)
Name of the resulting (gathered) value column, string or unquoted column name
Year pattern to match against
Remove NAs flag passed on to tidyr::gather
The gathered (reshaped) data frame.