[R] reading in data problems

Thomas Lumley tlumley at u.washington.edu
Fri Mar 11 16:23:56 CET 2005


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




More information about the R-help mailing list