Learn R Programming

DCC (version 1.2.1)

dcc_read: Read a data file into a dcc_data object

Description

Compatibility entry point over DCC's registered format adapters. New strict workflows use dcc_import with a declared import specification; this function retains automatic text-encoding detection and type inference for existing calls. The raw file is never modified.

Usage

dcc_read(path, format = "auto", encoding = "auto", ...)

Value

A dcc_data object with meta, a read report, and a provenance chain whose first record is the read operation.

Arguments

path

Path to the input file.

format

"auto", a registered format name, or the legacy "excel" alias for XLS/XLSX. Ambiguous extensions require an explicit format.

encoding

"auto" (default) or an explicit source encoding for text formats (e.g. "UTF-8", "GB18030", "BIG5", "latin1"). Ignored for binary formats.

...

Compatibility reader options. Strict protected options remain rejected by the adapter.

Examples

Run this code
f <- tempfile(fileext = ".csv")
writeLines(c("id,score", "S1,90", "S2,85"), f)
x <- dcc_read(f)
dcc_read_report(x)

Run the code above in your browser using DataLab