[R] how to get how many lines there are in a file.

Uwe Ligges ligges at statistik.uni-dortmund.de
Mon Dec 6 15:35:50 CET 2004


Hu Chen wrote:

> hi all
> If I wanna get the total number of lines in a big file without reading
> the file's content into R as matrix or data frame, any methods or
> functions?

You must read it in R, or how do you think should one determine the 
number of lines in a file (if you don't want to use another program)?
I'd suggest length(readLines(...)).

Uwe Ligges



> thanks in advance.
> Regards




More information about the R-help mailing list