Hi, my friends.

When a data file is large, loading the whole file into the memory all
together is not feasible. A feasible way  is to read one row, process it,
store the result, and read the next row.

In Fortran, by default, the 'read' command reads one line of a file, which
is convenient, and when the same 'read' command is executed the next time,
the next row of the same file will be read.

I tried to replicate such row-by-row reading in R.I use scan( ) to do so
with the "skip= xxx " option. It takes only seconds when the number of the
rows is within 1000. However, it takes hours to read 10000 rows. I think it
is because every time R reads, it needs to start from the first row of the
file and count xxx rows to find the row it needs to read. Therefore, it
takes more time for R to locate the row it needs to read.

Is there a solution to this problem?

Your help will be highly appreciated!
Best Wishes
 Yuchen Luo

	[[alternative HTML version deleted]]

