I am trying to read a big table (around 500000 x 1000) in R.
read.table
works, but is horribly slow.
scan
works, too, and is OK speedwise, but I have been unable to change its format to a normal data.frame or matrix.
I do not know the number of rows in the table in advance (I can find the number of columns by template_line <- read.table(nrow=1,file=my_file)
). It needs to be compatible with R 2.15 - so it seem fread
is out of the question.
So the question is either: How do I convert the output from:
my_matrix <- scan(file=my_file,what=template_line);
to a data.frame or matrix (fast)?
Or: how do I read a table of integers fast in R if I do not know the size?