read_clean_csv() reads a CSV file and cleans the column names in one step.
It leverages readr::read_csv() for reading and janitor::clean_names() for
making column names tidyverse-friendly (lowercase, no spaces, no special
characters). By default, column type messages are suppressed. Set
verbose = TRUE to display them.
Arguments
- file_path
A character string with the path to the CSV file.
- verbose
Logical. If
TRUE, displays column type messages fromreadr::read_csv(). Defaults toFALSE.
Examples
# \donttest{
# Read and clean a CSV file silently
sample_path <- system.file("templates", "sample.csv", package = "toolero")
data <- read_clean_csv(sample_path)
# Show column type messages
data <- read_clean_csv(sample_path, verbose = TRUE)
#> Rows: 344 Columns: 8
#> ── Column specification ────────────────────────────────────────────────────────
#> Delimiter: ","
#> chr (3): species, island, sex
#> dbl (5): bill_length_mm, bill_depth_mm, flipper_length_mm, body_mass_g, year
#>
#> ℹ Use `spec()` to retrieve the full column specification for this data.
#> ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
# }
