1
I have a '.xls' that I passed to '.txt' for the R reading, no problem. The point is that by opening '.txt' in R with read.table, it shows me as a single table, in a single R position.
> x
V1
1 X
2 30.80
3 0.00
4 0.00
5 2.10
6 0.00
7 0.00
8 0.00
9 85.40
10 0.00
11 0.20
12 0.00
13 0.00
14 0.00
15 0.00
16 0.00
17 0.00
18 0.20
19 0.00
20 11.70
21 0.00
22 13.60
23 0.00
24 24.70
25 66.80
26 0.00
27 3.70
28 46.20
29 416.10
30 90.80
31 0.00
32 0.00
33 0.00
34 40.10
35 23.60
36 63.20
37 54.30
38 20.20
39 30.00
40 23.00
41 1.80
42 2.00
43 31.20
44 20.20
45 150.60
46 50.80
47 3.30
48 4.00
49 10.40
50 0.70
51 8.60
52 0.00
53 0.00
54 9.30
55 0.00
56 0.00
57 176.70
58 4.90
59 68.80
60 17.70
61 9.80
62 9.60
63 0.00
64 47.00
65 0.00
66 0.00
67 2.10
68 0.00
69 144.60
70 83.10
71 55.30
72 3.50
73 0.00
74 0.00
75 5.50
76 47.80
77 52.60
78 154.10
79 47.60
80 13.40
81 0.00
82 37.10
83 0.00
84 0.00
85 0.00
86 27.40
87 0.00
88 0.00
89 40.60
90 67.80
91 0.00
92 0.00
93 19.00
94 154.30
95 14.60
96 0.00
97 9.20
98 0.00
99 0.00
100 0.00
101 0.00
102 0.00
103 147.70
104 108.40
105 55.80
106 37.60
107 62.80
108 80.00
109 51.40
110 23.60
111 10.80
112 12.00
113 0.00
When I do a simple 'for' so that it puts each value in a position to read R, it changes my values. And it’s not rounding, because the figures aren’t even close.
xnovo<-seq(1,113)
for (i in 1:113){
xnovo[i]<-x[i,1][1]}
> xnovo
[1] 67 29 1 1 23 1 1 1 60 1 2 1 1 1 1 1 1 2 1 7 1 10 1 26 54
[26] 1 33 40 39 62 1 1 1 37 25 53 48 22 28 24 19 21 30 22 14 45 31 36 4 3
[51] 61 1 1 64 1 1 17 44 56 18 66 65 1 41 1 1 23 1 11 58 50 32 1 1 49
[76] 43 47 15 42 9 1 34 1 1 1 27 1 1 38 55 1 1 20 16 12 1 63 1 1 1
[101] 1 1 13 6 51 35 52 57 46 25 5 8 1
Someone knows how to fix this?
Post also the reading code of the
.txt
for– Flavio Silva