Skip to contents

merge_insee_index() merges two INSEE indexes that may have different base years. It adjusts the older index to align with the newer index's base year and combines them.

Usage

merge_insee_index(
  old_index,
  new_index,
  base_new = "2020",
  verbose = TRUE,
  retrieve_info = FALSE
)

Arguments

old_index

data.frame, representing the older INSEE index, with row names as years and columns as series.

new_index

data.frame, representing the newer INSEE index, with row names as years and columns as series.

base_new

string, indicating the base year of the new index. Default set to "2020".

verbose

logical, indicating whether to print verbose messages. Default set to TRUE.

retrieve_info

logical, indicating whether to return if TRUE a list containing both the merged index and a flag indicating if a merge occurred and if FALSE returns

Value

A data frame representing the merged INSEE index, or a list containing the merged index and a merge flag if retrieve_info is TRUE. If the new index already covers the old index's years, the function returns the new index.

Examples