Message-ID: <Pine.A41.4.61b.0503110722390.127732@homer03.u.washington.edu>
Date: 2005-03-11T15:23:56Z
From: Thomas Lumley
Subject: reading in data problems
In-Reply-To: <1930.10.127.130.15.1110548433.squirrel@gpo.iitb.ac.in>
On Fri, 11 Mar 2005, Upasna Sharma wrote:
> Hi
>
> I have a dataset (.txt file and .dat file) in which the length of one
> record is 144. There is no header in the .txt or .dat file itself. When I
> read this file using the read.table command, and want to drop some
> coloumns by setting the argument colClasses to "NULL" for the columns that
> I want to drop, it does not work, because the entire record of the length
> 144 is being treated as one column only, of the type 'character'. I tried
> using read.fwf instead of read.table, but that doesn't seem to work
> either.
You should use read.fwf(). You didn't say what the problem was, so we
have to guess: did you try to use NULL to skip columns rather than using
negative field widths as the help page says?
-thomas
Thomas Lumley Assoc. Professor, Biostatistics
tlumley at u.washington.edu University of Washington, Seattle