Learn R Programming

bivarhr (version 0.1.5)

rc_auto: Read CSV with automatic delimiter detection

Description

Attempts to read a CSV file using several strategies, trying to infer whether the delimiter is a comma or a semicolon. It first tries readr::read_csv(), optionally falls back to readr::read_csv2() when a semicolon is detected or the first attempt fails, and finally tries base utils::read.csv() as a last resort.

Usage

rc_auto(fp)

Value

A data frame if a valid non-empty table could be read, or NULL if all attempts fail.

Arguments

fp

Character scalar; path to the CSV file.