This function reads in and combines sensitive data from a directory.

load_data(directory, files = NULL, download_csv = FALSE)

Arguments

directory

The directory containing the files

files

Optional character vector of file names to extract, eg. c("PY21Q2", "PY22Q3"). Otherwise, NULL, and all appropriate files from directory will be extracted.

download_csv

Defaults to FALSE. If TRUE, will write a csv file containing loaded and combined data to working R directory.

Value

A loaded and combined dataframe. Optionally, a csv data file written to the working directory.