prep_load_folder_with_metadata: Pre-load a folder with named (usually more than) one table(s)

View source: R/prep_load_folder_with_metadata.R

prep_load_folder_with_metadataR Documentation

Pre-load a folder with named (usually more than) one table(s)

Description

The original purpose of this function is to load metadata, not study data. If you want to load study data, you should keep them in a different folder, then you can call this function once for the metadata and once for the study data but this time setting keep_types = TRUE to avoid all data being read as character().

Usage

prep_load_folder_with_metadata(folder, keep_types = FALSE, ...)

Arguments

folder

the folder name to load.

keep_types

logical keep types as possibly defined in the file. set TRUE for study data.

...

arguments passed to list.files()

Details

Note, that once loaded to the data frame cache, a file won't be read again, except you call prep_purge_data_frame_cache() or prep_remove_from_cache(). That is, if you call this function first, and prep_get_data_frame() later, of if dataquieR wants to read a file, e.g., for dq_report2(), the file will come from the cache in the way it was initially read in (keep_types may thus be used inadequately).

By default, this function works not recursively, but you can tweak that by passing ...-arguments passed through to the initially running list.files() function.

These can thereafter be referred to by their names only. Such files are, e.g., spreadsheet-workbooks or RData-files.

Note, that this function in contrast to prep_get_data_frame does neither support selecting specific sheets/columns from a file.

Value

⁠invisible(the cache environment)⁠

See Also

prep_add_data_frames

prep_get_data_frame

Other data-frame-cache: prep_add_data_frames(), prep_get_data_frame(), prep_list_dataframes(), prep_load_workbook_like_file(), prep_purge_data_frame_cache(), prep_remove_from_cache()


dataquieR documentation built on Jan. 8, 2026, 5:08 p.m.