Skip to contents

Loads data into memory based on study directory and one or more file_names.

Usage

load_data(sub_dir = NULL, file_names, use_wd = FALSE, prefer_sas = FALSE)

Arguments

sub_dir

A relative directory/folder that will be appended to a base path defined by `Sys.getenv("RXD_DATA")`. If the argument is left as NULL, the function will load data from the working directory `getwd()`.

file_names

Study file or file_names name(s) - can be a vector of strings. This is the only required argument.

use_wd

for "use working directory" - a flag used when importing local files not on NFS - default value is FALSE

prefer_sas

if set to TRUE, imports sas7bdat files first before looking for RDS files (the opposite of default behavior)

Value

a list of dataframes

Examples

if (FALSE) {
test_data_path <- "../inst/extdata/"
data_list <- load_data(
  sub_dir = test_data_path,
  file_names = "dummyads2",
  use_wd = TRUE
)
}