[R] Reading a tab delimitted text

Srinivas Iyyer srini_iyyer_bio at yahoo.com
Tue Nov 30 21:18:11 CET 2004


Dear group,
 I have a tab delimitted text file with 21 column and
1988 rows. When I read the file:

D1 <-
read.table(file="gist_data1.txt",sep="\t",header=T)
> dim(D1)
[1] 1811   20

It reads only 1811 rows from that file.

I saved this file as CSV file and I read it again
using:

> D1 <-
read.csv(file="gist_data1.txt",sep=",",header=T)


> dim(D1)
[1] 1987    1
> 


This timer it reaad correct number of rows and wrong
column numbers. 

Can any one suggest how to read a tab-delimited text
file and read in corect number of lines. 


thank you.
		
__________________________________ 



More information about the R-help mailing list