[R] Fast way to determine number of lines in a file

hadley wickham h.wickham at gmail.com
Mon Feb 8 16:17:02 CET 2010

Hi Ken,

> How about something like
> length(readLines(fname))

I'm trying to avoid the overhead of reading the file in twice.  (I'm
trying to preallocate a data structure for a chunked read)



More information about the R-help mailing list