e_read_data_files: Read a list of csv, xls, or xlsx data into a list of tibbles

View source: R/e_read_data_files.R

e_read_data_filesR Documentation

Read a list of csv, xls, or xlsx data into a list of tibbles

Description

Called from e_read_data_subdir_into_lists().

Usage

e_read_data_files(
  read_fn_path = ".",
  read_fn_names = NULL,
  sw_dat_add_col_path_fn = c(TRUE, FALSE)[1],
  sw_dat_print_fn_read = c(TRUE, FALSE)[1],
  excel_sheets = "all",
  sw_clean_names = c(TRUE, FALSE)[2],
  excel_range = NULL,
  excel_col_names = TRUE,
  sw_delim = c(FALSE, "|")[1],
  sw_read_package_csv_txt = c("readr", "utils")[1]
)

Arguments

read_fn_path

Directory path

read_fn_names

Character list of file names

sw_dat_add_col_path_fn

T/F for data, add two columns specifying the directory (DIR__) and filename (FILE__)

sw_dat_print_fn_read

T/F print file names and dimensions as the files are read

excel_sheets

"all" for all sheets, or a list of numbers "c(1, 2)"; applies to all excel sheets.

sw_clean_names

T/F to clean column names using janitor::clean_names

excel_range

When reading Excel files, NULL reads entire sheet, a range is specified as in readxl::read_xlsx. Applies to all files.

excel_col_names

Specified as in readxl::read_xlsx. Applies to all files.

sw_delim

F if standard delim, otherwise delim character such as "|"

sw_read_package_csv_txt

"readr" for read_csv and read_delim, "utils" for read.csv and read.delim

Value

dat_sheet A list of tibbles

Examples

## Not run: 
# See e_read_data_subdir_into_lists()

## End(Not run)

erikerhardt/erikmisc documentation built on April 17, 2025, 10:48 a.m.