Re: [R] reading in data problems

From: Thomas Lumley <>
Date: Sat 12 Mar 2005 - 02:23:56 EST

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 Lumley			Assoc. Professor, Biostatistics	University of Washington, Seattle

______________________________________________ mailing list PLEASE do read the posting guide! Received on Mon Mar 14 09:57:38 2005

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