[R] FW: fairly simple file I/O

Cable, Samuel B Civ USAF AFMC AFRL/RVBXI Samuel.Cable at hanscom.af.mil
Wed Apr 7 21:15:17 CEST 2010


OK, my apologies.  I am sure this is a question that has been answered
before.  But I have looked all over the web and can't find an answer for
it.  I promise, wasting your time and bandwidth is my last resort.

 

So here goes:

 

I have an ASCII file formatted like so:

 

Label 1.1

Time 1

Label 1.2

Array of data from time 1

Label 2.1

Time 2

Label 2.2

Array of data from time 2

Label 3.1

Etc.

 

I just want an efficient way of reading this data in so that

 

1)      The "Label" values are ignored.

2)      The "Time" values go into a single vector.

3)      The "Array of data" values go into a single array.

 

The only thing I have been able to do is "scan" everything in to one
honking big list and then distribute the data out of this list one index
at a time.  Surely there is a more elegant way?  Thanks.



More information about the R-help mailing list