Re: [R] read.fortran format

2016-05-28 Thread William Dunlap via R-help
>The bit about the decimal leading to a shift in the decimal place >pointed out by Bill is a bit obscure, though it to is mentioned in the help file. I don't think that is how real Fortran formats work. My memory is that you only put a dot in the format if there were no dots in your data file (so

Re: [R] read.fortran format

2016-05-27 Thread Jeff Newmiller
Your rather sarcastic comment about knowledge given by John's mother seems inappropriate, given that he told you where his information came from and it is the first place you should have looked. The bit about the decimal leading to a shift in the decimal place pointed out by Bill is a bit obsc

Re: [R] read.fortran format

2016-05-27 Thread Steven Yen
That's great, John. Your mother told you when you were born? How am I supposed to know? Thank you both. The following format statement did it!! I just change F5.3 to F5, 5F8.4 to 5F8. I also change 2E15.9 to 2A9, and then use the following as.numeric to convert the alphanumerical to numerical. T

Re: [R] read.fortran format

2016-05-27 Thread William Dunlap via R-help
It has been a while since I used Fortran formatted input, but the following, without dots in the format, works: > txt <- "1950. .614350 .026834 .087227 .006821 .180001 4.56E-2" > print(read.fortran(textConnection(txt), c("f5", "6f8")), digits=10) V1 V2 V3 V4 V5 V6

Re: [R] read.fortran format

2016-05-27 Thread Steven Yen
Thanks John. That helped, but I got a mixed of good thing and bad thing. Good is R does not like the scientific number format "3E15.9" but I was able to read with alphanumerical format "3A15" (and convert to numerical). Bad is R does not like the numbers .1234, .2345 without the zeros before th

Re: [R] read.fortran format

2016-05-27 Thread John McKown
On Fri, May 27, 2016 at 12:56 PM, Steven Yen wrote: > 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. > >