[R] read.fortran format

Steven Yen syen04 at gmail.com
Fri May 27 19:56:32 CEST 2016


Dear fellow R users:
I am reading a data (ascii) file with fortran fixed format, containing 
multiple records. R does not recognize fortran's record break (a slash). 
I tried to do the following but it does not work. Help appreciated.

  60 FORMAT(1X,F6.0,5F8.6/1X,5F8.4,F10.6/1X,2F6.0,3E15.9,F8.0,F5.2,F5.3
      *      /1X,F7.0,2E15.9,F9.4,F5.3)

mydata<-read.fortran("G:/Journals/Disk1/12_restat_95/estimate/GROUPD.DAT",
         c("1X","F6.0","5F8.6"/"1X","5F8.4","F10.6"
          /"1X","2F6.0","3E15.9","F8.0","F5.2","F5.3"
          /"1X","F7.0","2E15.9","F9.4","F5.3"),
col.names=c("year","w1","w2","w3","w4","w5","w6","v1","v2","v3",
"v4","v5","v6","z","chyes","chno","ec","vc","cvc",
"pop","ahs","fah","tnh","eq","vq","ups","zm1 "))



	[[alternative HTML version deleted]]



More information about the R-help mailing list