Skip to contents

Get last value from baseline

Usage

get_baseline_value(
  value,
  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

value

(character vector) of values

year

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

type

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

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.