Learn R Programming

vectra (version 0.6.2)

tbl_csv: Create a lazy table reference from a CSV file

Description

Opens a CSV file for lazy, streaming query execution. Column types are inferred from the first 1000 rows. No data is read until collect() is called. Gzip-compressed files (.csv.gz) are supported transparently.

Usage

tbl_csv(path, batch_size = .DEFAULT_BATCH_SIZE)

Value

A vectra_node object representing a lazy scan of the CSV file.

Arguments

path

Path to a .csv or .csv.gz file.

batch_size

Number of rows per batch (default 65536).

Examples

Run this code
f <- tempfile(fileext = ".csv")
write.csv(mtcars, f, row.names = FALSE)
node <- tbl_csv(f)
print(node)
unlink(f)

Run the code above in your browser using DataLab