Skip to contents

Alias for load_data(). Reads data from various file formats including CSV, Excel, Parquet, and RDS files. Can handle a single file path or multiple file paths.

Usage

read_data(
  file_path,
  file_type = NULL,
  sheet = NULL,
  add_path_col = FALSE,
  path_col_name = "file_path",
  ...
)

Arguments

file_path

Character string or character vector with path(s) to file(s)

file_type

Optional character string specifying file type. If NULL (default), the function will detect the file type from the file extension.

sheet

Optional sheet name or number for Excel files (default is the first sheet)

add_path_col

Logical, if TRUE adds a column with the file path (default: FALSE)

path_col_name

Character string specifying the name of the path column (default: "file_path")

...

Additional parameters passed to the underlying read function

Value

A single dataframe when one file path is provided, or a combined dataframe when multiple paths are provided