[R] Help on read in a txt file

2008-04-24 Thread ssls sddd
Dear list, Hello! I had a problem of reading in a txt file and need your help. The txt file, called A, comprises of 592 columns and 34179 rows. I need to note that for some cells of A , A[i,j], are blank. I used read.table() and got the warning message: > A<-read.table(file="A.txt",sep="\t") War

Re: [R] Help on read in a txt file

2008-04-24 Thread jim holtman
You can read the first line in and determine which of the columns contain the names you want to use and then create the parameters for 'colClasses' to control which columns you want to read. Or you can just read in all the data and then delete the columns you don't need. On Thu, Apr 24, 2008 at 1

Re: [R] Help on read in a txt file

2008-04-24 Thread ss
Thanks Jim. I got this: > A<-read.table("a.txt", sep="\t", fill=TRUE) > dim(A) [1] 33623 592 > x <- count.fields("a.txt", sep="\t") which(x != 592) # print out the lines that are not correct > which(x != 592) # print out the lines that are not correct [1] 31279 31281 33625 > Actually, I jus

Re: [R] Help on read in a txt file

2008-04-24 Thread jim holtman
It seems to indicate that you don't have 592 columns on all lines. Try the following to see how many columns are in each line: x <- count.fields("A.txt", sep="\t") which(x != 592) # print out the lines that are not correct You might also try: read.table("a.txt", sep="\t", fill=TRUE) On Thu, Ap

[R] Help on read in a txt file

2008-04-24 Thread ss
Dear list, Hello! I had a problem of reading in a txt file and need your help. The txt file, called A, comprises of 592 columns and 34179 rows. I need to note that for some cells of A , A[i,j], are blank. I used read.table() and got the warning message: > A<-read.table(file="A.txt",sep="\t") War