[R] Reading many files at once

From: Srinivas Iyyer <srini_iyyer_bio_at_yahoo.com>
Date: Fri 01 Sep 2006 - 20:55:49 GMT


dear group,  

i have 100 files starting with 'hsa-*'.

ex. file:

fruit p-value


apple  0.0003
orange 0.004
kiwi   0.0003
peach  0.0004



I want to read all these files and create a single matrix. here each file may have different fruit names.  

in the matrix i want to have a union of all fruits and those should be the rows in the matrix and file names should be columns.

ex;

        hsa-1 hsa-2 hsa-3 hsa-4 hsa-5

apple   0.003   0.01   0.002   0.002  0.002
orange  0.003   0.01   0.002   0.002  0.002
kiwi    0.003   0.01   0.002   0.002  0.002
peach   0.003   0.01   0.002   0.002  0.002
banana  0.003   0.01   0.008   0.002  0.001
plum    0.003   0.01   0.009   0.002  0.005
mango   0.003   0.001  0.002   0.002  0.008

 

could any one help me please.

thank you.



R-help@stat.math.ethz.ch 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 Sat Sep 02 07:21:56 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 07 Sep 2006 - 07:51:17 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.