Read and Clean Raw Data from CSV or Excel
read_raw_data.Rd
This function reads a CSV or Excel (.xlsx) file and performs several cleaning steps:
Detects file type based on extension.
Optionally converts column names to uppercase using janitor::clean_names.
Attempts to parse character columns as dates in ymd format.
Converts remaining character columns to uppercase.
Arguments
- file
A string specifying the path to the CSV or Excel file.
- sheet
Optional: sheet name or index if reading an Excel file. Defaults to the first sheet.
- col_caps
Logical. Whether to convert column names to uppercase. Default is TRUE.
- str_caps
Deprecated. Character strings are now always converted to uppercase.