[R] reading and analyzing a text file

DAVID ARTETA GARCIA darteta001 at ikasle.ehu.es
Fri May 16 17:32:42 CEST 2008


here I show the first text lines and some of the data. There are  
actually 6272 rows in the dataframe. Actually the skip parameter works  
fine as some people already suggested.

ATF	1.0
20	5
"Type=Mapix Results 2"
"DateTime=2008/05/15 11:05:38"
"ConfigFile="
"GalFile=Y:\experimental\090508\_v1.0.gal"
"PixelSize=20"
"Wavelengths=635	532"
"ImageFiles=Y:\May_2008\B_1.0_090508\Images\B_1.0_090508_50.tif"
"RatioFormulations=W1/W2 (635/532)"
"FeatureType=Circular"
"Barcode=0581"
"BackgroundSubtraction=LocalFeature"
"ImageOrigin=2110, 5479"
"Creator=Mapix 3.0.0 (driver 1.0.25)"
"Scanner=is700 7A02C1 706008"
"Temperature=26.3"
"Comment="
"LaserPower=5.0	5.0"
"SoftwareVersion=3.5.0.1"
"Name"	"F532 Median"	"B532 Median"	"F635 Median"	"B635 Median"
"V001O01"	4964.0	125.0	220.0	112.0
"V001O01"	5340.5	122.0	240.5	95.0
"V001O02"	5536.0	117.0	273.0	122.0
"V001O02"	5800.5	115.0	285.5	108.0
"V001O03"	3201.0	131.0	226.0	122.0
.
.
.
...



Prof Brian Ripley <ripley at stats.ox.ac.uk> ha escrito:

> 1) read.table has a 'skip' argument which may suffice.
>
> 2) R has the concept of 'connections' to read sequentially through a
> file. See the 'R Data Import/Export' manual.
>
> If that is not enough hints, showing us an example usually intrigues
> people enough to offer working code.
>
> On Fri, 16 May 2008, DAVID ARTETA GARCIA wrote:
>
>> Dear list,
>>
>> I have a text file from a scanner that includes 20 lines of text   
>> (scanner settings) before it actually starts showing the readings   
>> in a tabular format (headings are ID, intensity, background and few  
>>  others).
>>
>> I am a biologist with some experience using R and my question is if  
>>  it is possible to read this file into an R workspace and store the  
>>  actual readings in a dataframe, avoiding the text at the begining.  
>>  It seems to me that this is not the actual purpose of R, but maybe  
>>  someone can point me to a method for doing this. Do I need to  
>> parse  the file with some other programming language? is it  
>> possible to  link, say, Perl or C++ with R to automate the reading  
>> and the  analysis of such files? The aim is to be able to automate  
>> this  analysis since these files are our routine experimental output.
>>
>> Thanks for your help,
>>
>> D.
>>
>> ______________________________________________
>> R-help at r-project.org 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.
>
> -- 
> Brian D. Ripley,                  ripley at stats.ox.ac.uk
> Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
> University of Oxford,             Tel:  +44 1865 272861 (self)
> 1 South Parks Road,                     +44 1865 272866 (PA)
> Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list