David Whiting wrote:

Thomas Lumley <[EMAIL PROTECTED]> writes:

[...]


If the file is large enough that you don't want to read the whole
thing at once you can read it in chunks using readLines(). If all the
lines are the same length you can find the size of the file and divide
by the length of a line.

Also, you don't say what OS you are on.  If it isn't Windows the
easiest thing would be to use wc.


Part of the reason I got into Linux was because I needed to do
(little?)  things that I found tricky to do in Windows and bit-by-bit
I accumulated various *nix tools that had been ported to DOS/Windows,
such as these found here:

http://unxutils.sourceforge.net/

So if your OS is Windows you could stick with it and still use wc
(assuming that it works in the same way as under Linux---I haven't
tested the version at this location).

Well, the also tools required to compile R and packages under Windows contain wc.


Anyway, the question is whether you want to write code that performs best for a given problem on a given machine, or you want to write portable code (e.g. to be used on machines without having wc installed).

Uwe Ligges


Dave


______________________________________________ [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

Reply via email to