Re: [R] Dropping coloumns while redaing dtaa from text file.

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Thu 10 Mar 2005 - 19:28:22 EST

On Thu, 10 Mar 2005, Upasna Sharma wrote:

> 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?

Yes.

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

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Thu Mar 10 19:42:39 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:42 EST