Hello R community,
I tried using read.table to read multiple tables in a single .txt file.
data <- read.table("3933001_jabor.txt", header = FALSE, fill = TRUE, stringsAsFactors = FALSE)
but it keeps returning my data in the wrong column in the last row of a table as shown below:
and my data supposed to read like this:
Day Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
1 15.0 0.5 3.5 0.0 4.6 0.0 0.0 ? 0.0 33.5 0.0 0.0
2 17.2 0.0 0.6 0.0 0.0 16.8 2.4 ? 2.5 11.3 0.0 0.0
3 0.5 0.0 0.0 0.0 26.4 36.0 0.0 ? 11.9 0.0 0.0 0.0
4 3.2 0.0 0.0 0.0 1.3 0.0 0.0 ? 0.0 3.0 4.9 0.0
5 9.0 0.0 0.0 0.0 12.4 0.0 0.0 ? 0.0 0.0 2.9 0.0
6 0.0 0.0 0.0 0.0 15.2 0.9 0.0 ? 1.1 0.0 5.8 0.0
7 0.0 2.4 0.0 0.0 13.0 0.0 0.0 ? 0.0 0.0 4.5 0.0
8 0.0 0.5 4.6 0.0 0.0 1.2 0.0 ? 16.0 0.0 15.6 0.0
9 0.0 0.4 0.7 0.0 0.0 0.0 0.0 0.6 0.0 10.3 15.5 0.0
10 3.9 0.9 0.0 0.0 9.0 0.0 0.0 1.6 0.0 28.8 0.0 0.0
11 16.3 0.0 19.0 0.0 2.7 1.4 0.0 0.0 5.3 0.8 0.0 0.0
12 0.0 0.0 31.0 0.0 32.9 15.3 0.0 0.0 0.0 0.0 0.0 0.0
13 8.5 3.3 0.0 0.0 0.0 4.5 0.0 0.0 0.0 0.0 17.3 0.0
14 0.0 0.6 0.0 0.0 0.0 34.5 0.0 0.5 0.0 0.0 0.0 1.4
15 0.0 0.0 0.0 0.0 0.0 0.7 ? 86.6 0.0 0.0 11.1 11.2
16 0.0 0.5 9.2 0.0 2.3 0.0 ? 0.0 4.3 0.0 0.0 17.7
17 45.0 0.0 0.0 0.0 0.0 0.0 ? 0.0 0.0 17.6 0.0 0.0
18 17.4 0.0 0.0 0.0 0.0 4.1 ? 0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