read_folder()
is a wrapper around lapply
to read an entire folder of files
into a list. A NULL
is returned if the file is unable to be read.
read_folder(
folder,
read_function,
pattern = NULL,
.clean_file_names = TRUE,
.basename = FALSE,
.id = NULL,
.recursive = TRUE,
...
)
A folder path to read.
The function to use to read each file.
An optional regex. Only file names which match the regular expression will be read.
Logical to clean names into snake_case or not.
Logical to only keep the basename()
of each file.
Character. Optionally add an id variable to each table, named as this value.
Logical to recursively load the folder.
Arguments passed to read_function
.
A list of output from the read_function
. A NULL
is returned if the file is
unable to be read.