Robust table reader with auto delimiter detection for .csv, .tsv, .txt,
and their .gz variants. Uses data.table::fread() and prints CLI messages.
read_table_flex(
file_path,
sep = NULL,
encoding = "UTF-8",
header = TRUE,
df = TRUE,
verbose = FALSE
)A data.frame (default) or data.table depending on df parameter.
Character. Path to the file to be read.
Optional. Field delimiter. If NULL, auto-detected by file extension.
Character. File encoding accepted by fread: "unknown", "UTF-8", or "Latin-1".
Logical. Whether the file contains a header row. Default: TRUE.
Logical. Return data.frame instead of data.table. Default: TRUE.
Logical. Show progress and details. Default: FALSE.