fread to read top n rows from a large file
Another workaround is to fetch the first 500 lines with shell command:
rdata<- fread(
cmd = paste('head -n 500', csvfile),
sep= "|", header=FALSE, col.names= colsinfile,
select= colstoselect, key = "keycolname", na.strings= c("", "NA")
)
I don't known why nrows
doesn't work, though.