Re: [R] R data import

From: Tuszynski, Jaroslaw W. <JAROSLAW.W.TUSZYNSKI_at_saic.com>
Date: Wed 12 Oct 2005 - 23:02:55 EST


A few suggestions:
- read.fwf function sounds like what you need, but I have never used it so I
am not sure
- use readLines and manually extract needed positions and convert them to
numbers

 Jarek

====================================================\==== 
 Jarek Tuszynski, PhD.                           o / \ 
 Science Applications International Corporation  <\__,|  
 (703) 676-4192                                   ">  \ 
 Jaroslaw.W.Tuszynski@saic.com                     `   \ 



-----Original Message-----
From: r-help-bounces@stat.math.ethz.ch
[mailto:r-help-bounces@stat.math.ethz.ch] Sent: Tuesday, October 11, 2005 7:52 PM
To: r-help@stat.math.ethz.ch
Subject: [R] R data import

Hello,

I hope all is well. I've gone through and searched just about all the manuals, faqs, contribs available on the data import/export process and have not found any answer to a specific question. Hopefully, I will be able to fall back upon the valuable expertise in mailing list. Here goes:

How can I import SPECIFIC columns of data in a fixed width file? E.g. I have a fwf with 40 variables ranging from 1 to 10 characters and at any given time, need only a few to analyze, like so:  <age: 2 char ><sex: 1 char><morning: 1 char><location: 3 char>......<family: 9 char><tagged: date>.......<weight at capture: 4 char><length at capture: 7 char>etc.
which looks something like:
02M1LOS...xxcanidae011289.....10001291412

In essence I am looking for functionality similar to the SAS pointer/informat method. I would appreciate any help anyone would be able to give!

Thanks so much for your help.

best,
Ratnendra Sharma
U Minn



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

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 Received on Wed Oct 12 23:26:02 2005

This archive was generated by hypermail 2.1.8 : Sun 23 Oct 2005 - 18:47:37 EST