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

Ken Knoblauch ken.knoblauch at inserm.fr
Mon Feb 8 15:33:19 CET 2010


Hadley Wickham <hadley <at> rice.edu> writes:

> 
> Hi all,
> 
> Is there a fast way to determine the number of lines in a file?  I'm
> looking for something like count.lines analogous to count.fields.
> 
> Hadley
How about something like
length(readLines(fname))

Ken



More information about the R-help mailing list