[R] Dealing with data of varying format

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Thu Jun 6 16:27:51 CEST 2002


"MATT BORKOWSKI" <mpb170 at psu.edu> writes:

> The headers are set up with equal spacing so that if you were
> programming in Fortran you could simply create variables of lengths
> 3, 13, 27, 24, and 15 and the data would be read in properly. For
> instance, the third line above would be read into 5 variables as
> demonstrated below, with underscores representing spaces:

> A_ _
> 823109_ _ _ _ _ _ _ 
> METEOR_(POST_/64)_ _ _ _ _ _ _ _ _ _
> GERMANY_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> unknown_ _ _ _ _ _ _ _

> Is there anything in R that would do something similar? 

Take a look at read.fwf().

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list