[R] Reading text file with fortran format

2014-10-13 Thread Steven Yen
Hello Any idea how to read a text file with fortran format, WITH MULTIPLE RECORDS? My fortran format is as follows, and I do know I need to change F7.4 to F7.0, and 2F2.0 to 2I2, etc. I just have no idea how to handle the "slash" (/) which dictates a jump to the next record in fortran. Thank yo

Re: [R] Reading text file with fortran format

2014-09-30 Thread Steven Yen
bject: [R] Reading text file with fortran format > > Hello > > I read data with fortran format: > mydata<-read.fortran('foo.txt', > c("4F10.4","F8.3","3F3.0","20F2.0")) > colnames(mydata)<-c("

Re: [R] Reading text file with fortran format

2014-09-30 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Steven Yen > Sent: Tuesday, September 30, 2014 2:04 PM > To: r-help > Subject: [R] Reading text file with fortran format > > Hello > > I read data

[R] Reading text file with fortran format

2014-09-30 Thread Steven Yen
Hello I read data with fortran format: mydata<-read.fortran('foo.txt', c("4F10.4","F8.3","3F3.0","20F2.0")) colnames(mydata)<-c("q1","q2","q3","q4","income","hhsize", "weekend","dietk","quart1","quart2","quart3","male","age35", "age50","age65","midwest","south","west","no