> From: Marc Schwartz > > On Mon, 2004-12-06 at 22:12 +0800, 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? > > thanks in advance. > > Regards > > See ?readLines > > You can use: > > length(readLines("FileName")) > > to get the number of lines read. > > HTH, > > Marc Schwartz
On a system equipped with `wc' (*nix or Windows with such utilities installed and on PATH) I would use that. Otherwise length(count.fields()) might be a good choice. Cheers, Andy ______________________________________________ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html