[R] how to emerge two tables by taking the ave.

2007-11-11 Thread affy snp
Dear list, I am new to R and very inexperienced. Sorry for the trouble. I have two txt files and want to merge them by taking the average. More specifically, for example, the txt file1, with row names and column names, consists of 238000 rows and 196 columns. Each column corresponds to a sample.

Re: [R] how to emerge two tables by taking the ave.

2007-11-11 Thread affy snp
Hi,Jim. I created two txt files as: x.txt id b1 b2 b3 a1 246 a2 12 NA a3 46 NA y.txt idb1 b2 b3 a1 NA44 a2 22 NA a3 122 I tried it one more time but got different z: x-read.table(file=x.txt,header=TRUE,row.names=1,na.strings = NA)

Re: [R] how to emerge two tables by taking the ave.

2007-11-11 Thread jim holtman
Here is the way to read the data and convert it. Your data was a dataframe with the first column being the id: x - read.table(textConnection(id b1 b2 b3 + a1 246 + a2 12 NA + a3 46 NA), header=TRUE) y - read.table(textConnection(idb1 b2 b3 + a1 NA44 + a2

Re: [R] how to emerge two tables by taking the ave.

2007-11-11 Thread affy snp
Hi Jim, However, the real file has 238000 row ids and 196 column ids. How could I read the file first and then convert it to a matrix? Allen On Nov 11, 2007 11:02 PM, jim holtman [EMAIL PROTECTED] wrote: Here is the way to read the data and convert it. Your data was a dataframe with the