[R] A question about *read.table()*

From: ss <affysnp_at_gmail.com>
Date: Fri, 30 May 2008 19:56:50 -0400


Hi list,

I have a question about using *read.table()* to read in a txt file. Basically, it
consists of 16346 rows, 6 columns (no header). The code I used is:

exprSet <- read.table('process_all4_GSA2.txt', row.names = 1,header =FALSE)

and I got an error message:

> exprSet <- read.table('process_all4_GSA2.txt', row.names = 1,header
=FALSE)
Error in read.table("process_all4_GSA2.txt", row.names = 1, header = FALSE) :
  duplicate 'row.names' are not allowed
In addition: Warning message:
In read.table("process_all4_GSA2.txt", row.names = 1, header = FALSE) :   incomplete final line found by readTableHeader on 'process_all4_GSA2.txt'

However, I have no problem with the code to read in a similar txt file which

consists of 22277 rows, 72 columns.

> exprSet <- read.table('70mel_GSA.txt', row.names = 1,header =FALSE)
> dim(exprSet)

[1] 22277 71
> exprSet[1:4,1:4]

         V2 V3 V4 V5

GENE1  DDR1 10.215229 8.546666 9.207030
GENE2  RFC2  8.028489 8.175520 9.090902
GENE3 HSPA6  4.633769 4.822625 5.125172
GENE4  PAX8  6.121433 6.396281 6.000987

The two txt files are of similar format. The only difference so far I can tell is that
the second file is of more rows and columns. Other than that, they are basically
the same. But I don't know what is the issue with the first txt file.

Thank you so much for your help!

Allen

        [[alternative HTML version deleted]]



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Mon 02 Jun 2008 - 04:24:19 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 02 Jun 2008 - 04:30:40 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive