Full_Name: Giovanni Bonafe'
Version: 2.2.0
OS: Linux
Submission from: (NULL) (195.62.164.225)


If the file "example.dat" is like this:

aaa bbb ccc
3.4 1.2 5.6
4.6 10  32
667 343 1.7

With the older 1.9.1, as expected:

> data<-read.fwf(file = "example.dat",widths=c(3,4,4),header=TRUE)
> data
    aaa   bbb  ccc
1   3.4   1.2  5.6
2   4.6  10.0 32.0
3 667.0 343.0  1.7

While with the newer 2.2.0:

> data<-read.fwf(file = "example.dat",widths=c(3,4,4),header=TRUE)
> data
   X3.4 X1.2 X5.6
1   4.6   10 32.0
2 667.0  343  1.7

On the other side, if I use the option header=FALSE, no difference occurs
between the two versions:

> data<-read.fwf(file = "example.dat",widths=c(3,4,4))
> data
   V1   V2   V3
1 aaa  bbb  ccc
2 3.4  1.2  5.6
3 4.6  10    32
4 667  343  1.7

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to