Import data in R (read.table) -


i have following file, want import.

                   monthly climatological summary mar. 2014  name: larissa   city:    state:   elev:    82 m  lat:  39° 37' 39" n  long:  22° 23' 55" e                     temperature (°c), rain  (mm), wind speed (km/hr)                                        heat  cool        avg     mean                              deg   deg         wind                 dom day temp  high   time   low    time   days  days  rain  speed high   time    dir ------------------------------------------------------------------------------------  1   9.7  11.3   15:50   7.6    7:20   8.6   0.0   5.4   1.3  12.9   20:10   nne  2  11.8  16.9   14:50   9.8   00:00   6.5   0.0   4.2   2.7  24.1   13:30    ne  3   9.3  11.5   14:20   7.9   00:00   9.0   0.0   6.0   0.8   9.7    3:00     n  4  10.7  17.0   15:10   4.7    6:30   7.7   0.0   1.6   0.6  16.1   18:50    sw  5  11.1  18.5   14:40   6.0    7:30   7.3   0.0   0.2   1.1  16.1   18:50   ssw  6  10.9  16.9   13:50   5.1    6:30   7.4   0.0   0.0   1.1  16.1   16:20   ene  7  11.3  13.8   14:20  10.1    9:00   7.1   0.0   7.0   3.9  25.7    4:20   nne  8  12.1  16.6   14:00   9.4    8:00   6.2   0.0   2.8   1.8  22.5   22:40   ene  9   9.0  10.4   13:10   7.6   00:00   9.3   0.0   0.4   1.8  27.4   10:40   nne 10   7.9  10.1   13:50   6.6   23:50  10.4   0.0   1.0   4.0  24.1   20:20    ne 11   7.8  10.1   14:20   5.4    5:30  10.6   0.0   0.8   1.1  16.1   11:00     n 12  11.3  18.7   15:30   6.8    7:10   7.0   0.0   0.0   1.3  20.9   14:20    sw 13  11.3  19.1   16:00   4.5    7:40   7.1   0.1   0.0   0.6  12.9   13:10   wsw 14  11.7  20.1   15:40   5.1    6:30   6.8   0.2   0.0   0.6  11.3   15:00   wnw 15  12.6  21.1   15:40   5.2    7:10   6.1   0.3   0.0   0.5   9.7   14:10   ssw 16  14.6  22.3   15:40   8.3    7:10   4.4   0.7   0.0   1.1  11.3   10:40   ene 17  15.0  24.3   15:10   7.1    6:10   4.6   1.3   0.0   1.0  12.9    7:10   ene 18  16.0  26.9   15:40   7.2    6:40   4.2   1.9   0.0   0.6  11.3   15:00   sse 19  17.7  28.4   15:10   8.2    6:50   3.3   2.7   0.0   1.8  24.1   23:40    sw 20  16.6  22.5   16:00  11.1   00:00   2.6   0.8   0.0   2.7  24.1    7:50     n 21  13.8  21.9   16:30   6.7    6:20   5.0   0.6   0.0   0.8  16.1   14:50   ene 22  14.3  24.1   15:40   5.8    5:40   4.9   0.9   0.0   0.5   9.7   13:50    sw 23  16.4  25.7   16:00   9.8    7:40   3.5   1.6   0.0   0.5   9.7   13:30   ese 24  16.3  24.9   14:50  10.2    6:10   3.2   1.1   0.0   2.4  29.0   16:10   ssw 25  14.1  21.0   15:40   9.2    6:40   4.5   0.3   0.0   3.9  32.2   14:50    sw 26  12.9  19.0   16:20   9.6    6:10   5.4   0.0   1.6   1.0  12.9   12:50     n 27  14.3  19.2   13:50  11.3    2:30   4.1   0.1   0.2   3.2  33.8   14:20   ene 28  13.1  19.0   15:40   7.4    6:30   5.3   0.0   0.4   1.4  17.7   15:50    sw 29  14.7  21.2   15:10  10.8    5:40   3.9   0.3   0.2   1.3  19.3   11:30   ene 30  12.6  17.2   15:30   9.2   00:00   5.4   0.0   0.0   2.6  25.7    4:00   ene 31  13.1  23.0   17:00   5.2    7:30   6.0   0.7   0.0   0.5   8.0   14:50    sw -------------------------------------------------------------------------------------     12.7  28.4    19     4.5    13   187.4  13.5  31.8   1.6  33.8    27     ene  max >=  32.0:  0 max <=   0.0:  0 min <=   0.0:  0 min <= -18.0:  0 max rain: 7.01 on 07/03/14 days of rain: 14 (> .2 mm) 5 (> 2 mm) 0 (> 20 mm) heat base:  18.3  cool base:  18.3  method: integration 

by trying use read.table header=t, dec=".", sep="" additional arguments, error:

error in read.table("c:\\blablabla\\file.txt)   more columns column names execution halted 

i think file not \t separated rather "". thinking might caused text before table. read.csv make difference?

any suggestions? in advance.

the problem fact there additional information listed above column names. skipping solve issue. this, can use skip parameter part of read.csv.

dat = read.csv('/path/to/file.csv', header = true, dev = ".", sep = "", skip = 9) 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -