| read_dbc | R Documentation |
High-level convenience wrapper. The native engine decodes small files
directly into R columns without temporary files. Larger files use a
temporary CSV and data.table::fread() (if available) or
utils::read.csv().
read_dbc(
file,
batch_size = 4096L,
encoding = "CP850",
verbose = FALSE,
cols = NULL,
coerce_types = TRUE,
engine = c("auto", "native", "data.table", "base"),
native_threshold = 50 * 1024^2,
...
)
file |
Character string. Path to the |
batch_size |
Integer. Passed to |
encoding |
Character string. Source encoding of character fields.
Default |
verbose |
Logical. Passed to |
cols |
Character vector or |
coerce_types |
Logical. If
|
engine |
Character string selecting the reader. |
native_threshold |
Non-negative number of bytes. In |
... |
Additional arguments forwarded to the CSV reader. |
For files with more than one million records, use dbc_to_csv
directly and load the resulting CSV with arrow::read_csv_arrow() or
data.table::fread() for maximum performance.
A data.frame or data.table (if data.table
is installed).
dbc <- system.file("extdata", "sids.dbc", package = "dbcturbo")
df <- read_dbc(dbc)
head(df)
# Read a subset of fields.
fields <- dbc_inspect(dbc)$fields$name[1:3]
selected <- read_dbc(dbc, cols = fields)
names(selected)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.