[R] Importing from Fortan

Spartina lea_olsen at yahoo.ca
Mon Oct 10 13:45:10 CEST 2011


Hello all,

how do I import a Fortran file (f3.1) into one column in R? I've tried this
(I'm a total beginner as you can see): 

> FortranData<-read.fwf("C:\\Users\\format3_1.txt",rep(3,20))
Warning message:
In readLines(file, n = thisblock) :
  incomplete final line found on 'C:\Users\format3_1.txt'
> FortranData
   V1  V2  V3  V4  V5  V6  V7  V8  V9 V10 V11 V12 V13 V14 V15 V16 V17 V18
V19 V20
1 2.2 3.3 4.2 2.1 3.4 2.3 2.3 4.2 2.1 3.4 2.3 2.3 4.2 2.1 3.4 2.3 2.3 4.2
2.1 3.4

As you can see, each datum gets imported into a separate column, whereas I'd
like to have everything stored under V1. I'm also unsure as to what the
error message means.

Thanks in advance for your help!

Léa

--
View this message in context: http://r.789695.n4.nabble.com/Importing-from-Fortan-tp3889947p3889947.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list