Skip to content

Dropping coloumns while redaing dtaa from text file.

3 messages · Upasna Sharma, Peter Dalgaard, Brian Ripley

#
Hi

I have a huge text file and .dat file from which I want to read data. I do
not need all the columns in the files. I want to extract only some columns
from the .txt file or the .dat file, because reading the entire file is
becoming very difficult due to memory issues. Is it possible to extract a
few columns from .txt or .dat file while reading the data in R?

Thanks
Upasna
#
"Upasna Sharma" <upasna at iitb.ac.in> writes:
You're not sayin what tools you are using to read in the first place,
but notice that the colClasses argument to read.table can have NULL
elements.
#
On Thu, 10 Mar 2005, Upasna Sharma wrote:

            
Yes.

Look at the use of NULL for 'colClasses' (read.table) or 'what' (scan), 
and also 'flush'.