Skip to contents

Matches the survey's identifying keys (country, year, acronym) against the auxiliary dataset, filters the relevant rows, and appends the result as a named element of the attribute list.

Usage

add_attr(ls, measure, aux_data, keys)

Arguments

ls

A named list of existing survey attributes.

measure

Character scalar. The auxiliary measure name (e.g., "cpi", "ppp", "pop", "gdp", "pce").

aux_data

A data.table of auxiliary data for the given measure.

keys

Character vector of primary-key column names for aux_data.

Value

The input ls with a new element named measure appended, or unmodified if no matching auxiliary rows were found.