Use the nrows
argument in read.csv(...)
df <- read.csv(file="my.large.file.csv",nrows=2000)
There is also a skip=
parameter that tells read.csv(...)
how many lines to skip before you start reading.
If your file is that large you might be better off using fread(...)
in the data.table package. Same arguments.