Message-ID: <49706FB8.8050506@idi.ntnu.no>
Date: 2009-01-16T11:30:00Z
From: Wacek Kusnierczyk
Subject: Value Lookup from File without Slurping
In-Reply-To: <497066FF.3030100@quantide.com>
r at quantide.com wrote:
>
> Using file() is not a real reading of all the file. This function will
> simply open a connection to the file without reading it.
> countLines should do something lile "wc -l" from a bash shell
just for a test:
cat(rep('', 10^7), file='test.txt', fill=1)
library(R.utils)
system.time(countLines('test.txt'))
... and the file is just about 30MB (and it makes no real difference if
it is stuffed with newlines or not).
vQ