Skip to contents

Get last year from baseline

Usage

get_baseline_year(
  year,
  type,
  scenario_col = NULL,
  scenario = NULL,
  baseline_year,
  type_filter = c("all", "reported", "estimated", "projected", "imputed"),
  direction = c("before", "after"),
  na_rm = TRUE
)

Arguments

year

(character vector) of years.

type

(character vector) of years. Must be the same length as year

scenario_col

(character vector) of scenarios. Must be the same length as value

scenario

name of scenario in which to look for the baseline value

baseline_year

Year integer at which to get the baseline_value

type_filter

(character vector) vector of types to be filtered for.

direction

direction in which the last value should be found. before (default) looks in years before baseline_year, while after looks in years following baseline_year.

na_rm

(Boolean) indicating if NA should be removed (default) from type_filter or not.