[R] how to import this kind of data?

Soyeon Kim yunni0731 at gmail.com
Sat Sep 18 00:03:52 CEST 2010


Dear All,

I am in a trouble with reading data.

It is in txt file looking like this.

 0.00632  18.00   2.310  0  0.5380  6.5750  65.20  4.0900   1  296.0  15.30
  396.90   4.98  24.00
 0.02731   0.00   7.070  0  0.4690  6.4210  78.90  4.9671   2  242.0  17.80
  396.90   9.14  21.60
 0.02729   0.00   7.070  0  0.4690  7.1850  61.10  4.9671   2  242.0  17.80
  392.83   4.03  34.70
 0.03237   0.00   2.180  0  0.4580  6.9980  45.80  6.0622   3  222.0  18.70
  394.63   2.94  33.40
 0.06905   0.00   2.180  0  0.4580  7.1470  54.20  6.0622   3  222.0  18.70
  396.90   5.33  36.20
 0.02985   0.00   2.180  0  0.4580  6.4300  58.70  6.0622   3  222.0  18.70
  394.12   5.21  28.70
 0.08829  12.50   7.870  0  0.5240  6.0120  66.60  5.5605   5  311.0  15.20
  395.60  12.43  22.90
 0.14455  12.50   7.870  0  0.5240  6.1720  96.10  5.9505   5  311.0  15.20
  396.90  19.15  27.10

There are 14 variables. Therefore, the first of row should be at the
end of the second row.
So after importing the data, this should look like
  v1           v2        v3       v4 v5        v6         v7       v8
        v9 v10      v11   v12        v13    v14
  0.00632  18.00   2.310  0  0.5380  6.5750  65.20  4.0900   1  296.0
15.30 396.90   4.98  24.00
and so on.

How can import this kind of data into R?

Thank you,



More information about the R-help mailing list