I am getting below error when reading first n rows from a big file(around 50 GB) using fread
. Looks like a memory issue. I tried to use nrows=1000
. But no luck. Using linux
file ok but could not memory map it. This is a 64bit process. There is probably not enough contiguous virtual memory available.
Can this below code be replaced with read.csv
with all options as used below? Does it help?
rdata<- fread(
file=csvfile, sep= "|", header=FALSE, col.names= colsinfile,
select= colstoselect, key = "keycolname", na.strings= c("", "NA")
, nrows= 500
)
csvfile
withpaste('head -n 500', csvfile)
? – IngallsFile 'head -n 500 /csvfile' doesnt exist
– Colossalinput = "head -n 500 /path/to/csvfile"
. Please use theinput
argument rather thanfile
argument to allow shell commands. I do not have a file that large to test. I hope this works. – Ingallsinput
it works!.. You should put this as answer – Colossal