I'm working with several large CSV files, large enough that I can't efficiently load them into memory.
Instead I would like to read a sample of data from each file. There have been other posts about this topic (such as Load a small random sample from a large csv file into R data frame ) but my requirements are a little different as I would like to read in the same rows from each file.
Using read.csv()
with skip
and nrows=1
would be very slow and tedious.
Does anyone have a suggestion for how to efficiently load the same N rows from several CSVs without reading them all into memory?