Skip to contents

Compiles all files from BHPS and UKHLS into one file

Usage

usoc_compile(
  directory,
  extra_mappings = NULL,
  save_variables_report = TRUE,
  save_to_folder = FALSE,
  file = "indresp"
)

Arguments

directory

Directory with bhps/ and ukhls/

extra_mappings

function with extra columns to compile

save_variables_report

Save a csv with a summary of variables?

save_to_folder

If TRUE, will save to the DATA_DIRECTORY environment variable if present

file

Which file of the usoc data to compile? By default indresp, but also works on youth, child, etc.

Details

To automatically save this file in a directory to be used between projects, set a system variable called DATA_DIRECTORY pointing at a folder.

To do that just for R sessions, add the line below to .Rprofile:

Sys.setenv(DATA_DIRECTORY = "~/path/to/folder")