Efficiently reads a contiguous rectangular block of rows and columns from a
CSV file using readr::read_csv. Useful for processing big data in
chunks without loading the entire file into memory.
Arguments
- filename
Character. Path to the CSV file.
- rows
Integer vector of length 2 giving the first and last row indices to read (1-based, excluding the header row if
header = TRUE). Usec(1, Inf)to read all rows. Defaults toc(1, Inf).- cols
Integer vector of length 2 giving the first and last column indices to read. Use
c(1, Inf)to read all columns. Defaults toc(1, Inf).- header
Logical. Whether the file has a header row. Defaults to
TRUE.
