gather_years: Helper function: call 'tidyr::gather' for year-like columns...

View source: R/pipeline-helpers.R

gather_yearsR Documentation

Helper function: call tidyr::gather for year-like columns and convert them to integers

Description

Helper function: call tidyr::gather for year-like columns and convert them to integers

Usage

gather_years(
  d,
  value_col = "value",
  year_pattern = YEAR_PATTERN,
  na.rm = FALSE
)

Arguments

d

Data frame to operate on (a tibble)

value_col

Name of the resulting (gathered) value column, string or unquoted column name

year_pattern

Year pattern to match against

na.rm

Remove NAs flag passed on to tidyr::gather

Value

The gathered (reshaped) data frame.


JGCRI/gcamdata documentation built on March 21, 2023, 2:19 a.m.