Skip to contents

Splits survey_id on "_" into country code, year, survey acronym, master/alt versions, collection, and module. Sets derived attributes (tool, gd_type, survey_id) and subsets columns to only welfare, weight, and demographic variables.

Usage

survey_id_to_attr(dt, survey_id)

Arguments

dt

A data.table of survey micro-data.

survey_id

Character scalar. The full survey identifier string.

Value

The input data.table with added attributes and reduced columns.