Re: [R] how to process multiple data files using R loop

2014-08-12 Thread Fix Ace
Thank you very much for all replies:) Here is my working code: for(i in ls(pattern=P_)){print(head(get(i),2))} On Monday, August 11, 2014 11:04 AM, Greg Snow 538...@gmail.com wrote: In addition to the solution and comments that you have already received, here are a couple of additional

Re: [R] how to process multiple data files using R loop

2014-08-11 Thread Greg Snow
In addition to the solution and comments that you have already received, here are a couple of additional comments: This is a variant on FAQ 7.21, if you had found that FAQ then it would have told you about the get function. The most important part of the answer in FAQ 7.21 is the last part where

[R] how to process multiple data files using R loop

2014-08-08 Thread Fix Ace
I have 16 files and would like to check the information of their first two lines, what I did: ls(pattern=P_)  [1] P_3_utr_source_data   P_5_utr_source_data   [3] P_exon_per_gene_cds_source_data   P_exon_per_gene_source_data   [5] P_exon_source_data   

Re: [R] how to process multiple data files using R loop

2014-08-08 Thread David Winsemius
On Aug 8, 2014, at 11:25 AM, Fix Ace wrote: I have 16 files and would like to check the information of their first two lines, what I did: ls(pattern=P_) [1] P_3_utr_source_data P_5_utr_source_data [3] P_exon_per_gene_cds_source_data

Re: [R] how to process multiple data files using R loop

2014-08-08 Thread William Dunlap
for(i in ls(pattern=P_)){ head(get(i), 2)} # Should work. You also need to use print(head(...)) if you want to see the printed output from each iteration. Bill Dunlap TIBCO Software wdunlap tibco.com On Fri, Aug 8, 2014 at 4:36 PM, David Winsemius dwinsem...@comcast.net wrote: On Aug 8,

Re: [R] how to process multiple data files using R loop

2014-08-08 Thread Rolf Turner
On 09/08/14 06:25, Fix Ace wrote: I have 16 files and would like to check the information of their first two lines, what I did: ls(pattern=P_) [1] P_3_utr_source_data P_5_utr_source_data [3] P_exon_per_gene_cds_source_data P_exon_per_gene_source_data [5]