Você está na página 1de 6

> d2=read.csv("C:\\Users\\Arab\\Desktop\\xdata.

csv")
> d2
rep Location Genotype t yield y p ly sy
1 r2 L2 g1 4 276.68 1.88 303.64 1.06 1.54
2 r1 L2 g1 4 298.29 2.03 303.64 1.11 1.59
3 r3 L2 g1 4 330.22 2.25 303.64 1.18 1.66
4 r4 L2 g1 4 1234.98 8.40 303.64 2.24 2.98
5 r1 L1 g1 4 813.89 5.54 -23.00 1.88 2.46
6 r4 L1 g1 4 1065.75 7.25 -23.00 2.11 2.78
7 r2 L1 g1 4 1253.54 8.53 -23.00 2.25 3.00
8 r3 L1 g1 4 1494.99 10.17 -23.00 2.41 3.27
9 r1 L3 g1 4 72.03 0.49 -101.66 0.40 0.99
10 r3 L3 g1 4 125.98 0.86 -101.66 0.62 1.16
11 r4 L3 g1 4 134.65 0.92 -101.66 0.65 1.19
12 r2 L3 g1 4 368.97 2.51 -101.66 1.26 1.73
13 r4 L2 g10 4 105.11 0.72 303.64 0.54 1.10
14 r1 L2 g10 4 152.41 1.04 303.64 0.71 1.24
15 r2 L2 g10 4 182.38 1.24 303.64 0.81 1.32
16 r3 L2 g10 4 384.04 2.61 303.64 1.28 1.76
17 r2 L1 g10 4 513.52 3.49 -23.00 1.50 2.00
18 r4 L1 g10 4 523.32 3.56 -23.00 1.52 2.01
19 r1 L1 g10 4 677.67 4.61 -23.00 1.72 2.26
20 r3 L1 g10 4 750.44 5.11 -23.00 1.81 2.37
21 r4 L3 g10 4 44.10 0.30 -101.66 0.26 0.89
22 r1 L3 g10 4 108.63 0.74 -101.66 0.55 1.11
23 r3 L3 g10 4 122.30 0.83 -101.66 0.61 1.15
24 r2 L3 g10 4 265.63 1.81 -101.66 1.03 1.52
25 r1 L2 g11 4 82.81 0.56 303.64 0.45 1.03
26 r4 L2 g11 4 176.40 1.20 303.64 0.79 1.30
27 r3 L2 g11 4 220.50 1.50 303.64 0.92 1.41
28 r2 L2 g11 4 420.61 2.86 303.64 1.35 1.83
29 r3 L1 g11 4 783.02 5.33 -23.00 1.84 2.41
30 r1 L1 g11 4 1344.56 9.15 -23.00 2.32 3.11
31 r2 L1 g11 4 1404.48 9.55 -23.00 2.36 3.17
32 r4 L1 g11 4 1439.87 9.80 -23.00 2.38 3.21
33 r1 L3 g11 4 81.29 0.55 -101.66 0.44 1.03
34 r2 L3 g11 4 206.54 1.41 -101.66 0.88 1.38
35 r4 L3 g11 4 258.72 1.76 -101.66 1.02 1.50
36 r3 L3 g11 4 351.33 2.39 -101.66 1.22 1.70
37 r4 L2 g12 4 569.83 3.88 303.64 1.58 2.09
38 r3 L2 g12 4 581.00 3.95 303.64 1.60 2.11
39 r2 L2 g12 4 624.04 4.25 303.64 1.66 2.18
40 r1 L2 g12 4 714.92 4.86 303.64 1.77 2.32
41 r1 L1 g12 4 891.56 6.07 -23.00 1.96 2.56
42 r4 L1 g12 4 1003.80 6.83 -23.00 2.06 2.71
43 r2 L1 g12 4 1189.25 8.09 -23.00 2.21 2.93
44 r3 L1 g12 4 1354.36 9.21 -23.00 2.32 3.12
45 r3 L3 g12 4 188.60 1.28 -101.66 0.83 1.34
46 r4 L3 g12 4 346.63 2.36 -101.66 1.21 1.69
47 r2 L3 g12 4 388.08 2.64 -101.66 1.29 1.77
48 r1 L3 g12 4 496.86 3.38 -101.66 1.48 1.97
49 r2 L2 g13 4 53.64 0.36 303.64 0.31 0.93
50 r1 L2 g13 4 159.05 1.08 303.64 0.73 1.26
51 r4 L2 g13 4 177.46 1.21 303.64 0.79 1.31
52 r3 L2 g13 4 267.76 1.82 303.64 1.04 1.52
53 r2 L1 g13 4 278.12 1.89 -23.00 1.06 1.55
54 r1 L1 g13 4 402.78 2.74 -23.00 1.32 1.80
55 r4 L1 g13 4 484.51 3.30 -23.00 1.46 1.95
56 r3 L1 g13 4 667.38 4.54 -23.00 1.71 2.24
57 r1 L3 g13 4 51.45 0.35 -101.66 0.30 0.92
58 r2 L3 g13 4 73.50 0.50 -101.66 0.41 1.00
59 r3 L3 g13 4 134.06 0.91 -101.66 0.65 1.19
60 r4 L3 g13 4 136.42 0.93 -101.66 0.66 1.19
61 r4 L2 g14 4 0.00 0.00 303.64 0.00 0.71
62 r3 L2 g14 4 159.35 1.08 303.64 0.73 1.26
63 r1 L2 g14 4 480.40 3.27 303.64 1.45 1.94
64 r2 L2 g14 4 969.02 6.59 303.64 2.03 2.66
65 r2 L1 g14 4 125.44 0.85 -23.00 0.62 1.16
66 r3 L1 g14 4 611.52 4.16 -23.00 1.64 2.16
67 r1 L1 g14 4 1114.26 7.58 -23.00 2.15 2.84
68 r4 L1 g14 4 1402.38 9.54 -23.00 2.36 3.17
69 r4 L3 g14 4 55.86 0.38 -101.66 0.32 0.94
70 r3 L3 g14 4 226.82 1.54 -101.66 0.93 1.43
71 r1 L3 g14 4 265.48 1.81 -101.66 1.03 1.52
72 r2 L3 g14 4 445.41 3.03 -101.66 1.39 1.88
73 r2 L2 g15 4 282.06 1.92 303.64 1.07 1.56
74 r1 L2 g15 4 313.40 2.13 303.64 1.14 1.62
75 r4 L2 g15 4 337.22 2.29 303.64 1.19 1.67
76 r3 L2 g15 4 1225.98 8.34 303.64 2.23 2.97
77 r1 L1 g15 4 737.21 5.02 -23.00 1.79 2.35
78 r2 L1 g15 4 874.65 5.95 -23.00 1.94 2.54
79 r3 L1 g15 4 948.52 6.45 -23.00 2.01 2.64
80 r4 L1 g15 4 1069.32 7.27 -23.00 2.11 2.79
81 r4 L3 g15 4 66.15 0.45 -101.66 0.37 0.97
82 r1 L3 g15 4 71.00 0.48 -101.66 0.39 0.99
83 r3 L3 g15 4 74.53 0.51 -101.66 0.41 1.00
84 r2 L3 g15 4 158.76 1.08 -101.66 0.73 1.26
85 r1 L2 g16 4 37.38 0.25 303.64 0.23 0.87
86 r4 L2 g16 4 143.77 0.98 303.64 0.68 1.22
87 r3 L2 g16 4 144.19 0.98 303.64 0.68 1.22
88 r2 L2 g16 4 186.63 1.27 303.64 0.82 1.33
89 r2 L1 g16 4 343.98 2.34 -23.00 1.21 1.69
90 r1 L1 g16 4 456.29 3.10 -23.00 1.41 1.90
91 r3 L1 g16 4 607.11 4.13 -23.00 1.64 2.15
92 r4 L1 g16 4 700.31 4.76 -23.00 1.75 2.29
93 r2 L3 g16 4 44.39 0.30 -101.66 0.26 0.90
94 r3 L3 g16 4 86.73 0.59 -101.66 0.46 1.04
95 r4 L3 g16 4 130.10 0.89 -101.66 0.63 1.18
96 r1 L3 g16 4 154.35 1.05 -101.66 0.72 1.24
97 r1 L2 g2 4 217.71 1.48 303.64 0.91 1.41
98 r2 L2 g2 4 292.71 1.99 303.64 1.10 1.58
99 r4 L2 g2 4 826.14 5.62 303.64 1.89 2.47
100 r3 L2 g2 4 1149.51 7.82 303.64 2.18 2.88
101 r4 L1 g2 4 850.25 5.78 -23.00 1.91 2.51
102 r1 L1 g2 4 1096.62 7.46 -23.00 2.14 2.82
103 r2 L1 g2 4 1252.86 8.52 -23.00 2.25 3.00
104 r3 L1 g2 4 2017.43 13.72 -23.00 2.69 3.77
105 r2 L3 g2 4 51.45 0.35 -101.66 0.30 0.92
106 r4 L3 g2 4 62.48 0.43 -101.66 0.35 0.96
107 r3 L3 g2 4 117.60 0.80 -101.66 0.59 1.14
108 r1 L3 g2 4 690.90 4.70 -101.66 1.74 2.28
109 r2 L2 g17 4 198.74 1.35 303.64 0.86 1.36
110 r1 L2 g17 4 235.57 1.60 303.64 0.96 1.45
111 r4 L2 g17 4 292.38 1.99 303.64 1.09 1.58
112 r3 L2 g17 4 314.14 2.14 303.64 1.14 1.62
113 r1 L1 g17 4 207.76 1.41 -23.00 0.88 1.38
114 r2 L1 g17 4 295.96 2.01 -23.00 1.10 1.59
115 r4 L1 g17 4 651.95 4.44 -23.00 1.69 2.22
116 r3 L1 g17 4 782.78 5.33 -23.00 1.84 2.41
117 r3 L3 g17 4 148.18 1.01 -101.66 0.70 1.23
118 r4 L3 g17 4 153.03 1.04 -101.66 0.71 1.24
119 r2 L3 g17 4 160.23 1.09 -101.66 0.74 1.26
120 r1 L3 g17 4 338.10 2.30 -101.66 1.19 1.67
121 r4 L2 g3 4 128.18 0.87 303.64 0.63 1.17
122 r3 L2 g3 4 243.37 1.66 303.64 0.98 1.47
123 r1 L2 g3 4 273.77 1.86 303.64 1.05 1.54
124 r2 L2 g3 4 719.18 4.89 303.64 1.77 2.32
125 r1 L1 g3 4 797.03 5.42 -23.00 1.86 2.43
126 r3 L1 g3 4 1045.38 7.11 -23.00 2.09 2.76
127 r2 L1 g3 4 1081.43 7.36 -23.00 2.12 2.80
128 r4 L1 g3 4 2015.37 13.71 -23.00 2.69 3.77
129 r1 L3 g3 4 83.50 0.57 -101.66 0.45 1.03
130 r2 L3 g3 4 171.26 1.17 -101.66 0.77 1.29
131 r3 L3 g3 4 198.74 1.35 -101.66 0.86 1.36
132 r4 L3 g3 4 426.59 2.90 -101.66 1.36 1.84
133 r1 L2 g4 4 135.24 0.92 303.64 0.65 1.19
134 r4 L2 g4 4 181.65 1.24 303.64 0.80 1.32
135 r3 L2 g4 4 233.27 1.59 303.64 0.95 1.44
136 r2 L2 g4 4 260.65 1.77 303.64 1.02 1.51
137 r4 L1 g4 4 907.48 6.17 -23.00 1.97 2.58
138 r2 L1 g4 4 1318.38 8.97 -23.00 2.30 3.08
139 r1 L1 g4 4 1365.14 9.29 -23.00 2.33 3.13
140 r3 L1 g4 4 1467.80 9.99 -23.00 2.40 3.24
141 r1 L3 g4 4 109.22 0.74 -101.66 0.56 1.11
142 r4 L3 g4 4 212.12 1.44 -101.66 0.89 1.39
143 r3 L3 g4 4 249.31 1.70 -101.66 0.99 1.48
144 r2 L3 g4 4 403.96 2.75 -101.66 1.32 1.80
145 r2 L2 g5 4 0.00 0.00 303.64 0.00 0.71
146 r4 L2 g5 4 84.08 0.57 303.64 0.45 1.04
147 r1 L2 g5 4 274.74 1.87 303.64 1.05 1.54
148 r3 L2 g5 4 833.15 5.67 303.64 1.90 2.48
149 r2 L1 g5 4 0.00 0.00 -23.00 0.00 0.71
150 r4 L1 g5 4 0.00 0.00 -23.00 0.00 0.71
151 r1 L1 g5 4 651.21 4.43 -23.00 1.69 2.22
152 r3 L1 g5 4 726.18 4.94 -23.00 1.78 2.33
153 r4 L3 g5 4 23.52 0.16 -101.66 0.15 0.81
154 r1 L3 g5 4 29.40 0.20 -101.66 0.18 0.84
155 r3 L3 g5 4 34.25 0.23 -101.66 0.21 0.86
156 r2 L3 g5 4 125.83 0.86 -101.66 0.62 1.16
157 r2 L2 g6 4 26.17 0.18 303.64 0.16 0.82
158 r3 L2 g6 4 86.29 0.59 303.64 0.46 1.04
159 r4 L2 g6 4 119.78 0.81 303.64 0.60 1.15
160 r1 L2 g6 4 1661.84 11.31 303.64 2.51 3.44
161 r2 L1 g6 4 441.00 3.00 -23.00 1.39 1.87
162 r3 L1 g6 4 464.52 3.16 -23.00 1.43 1.91
163 r4 L1 g6 4 467.46 3.18 -23.00 1.43 1.92
164 r1 L1 g6 4 628.18 4.27 -23.00 1.66 2.18
165 r4 L3 g6 4 72.47 0.49 -101.66 0.40 1.00
166 r3 L3 g6 4 79.38 0.54 -101.66 0.43 1.02
167 r1 L3 g6 4 220.50 1.50 -101.66 0.92 1.41
168 r2 L3 g6 4 242.11 1.65 -101.66 0.97 1.47
169 r1 L2 g7 4 81.00 0.55 303.64 0.44 1.03
170 r2 L2 g7 4 100.77 0.69 303.64 0.52 1.09
171 r3 L2 g7 4 156.80 1.07 303.64 0.73 1.25
172 r4 L2 g7 4 250.97 1.71 303.64 1.00 1.49
173 r3 L1 g7 4 761.04 5.18 -23.00 1.82 2.38
174 r2 L1 g7 4 1186.78 8.07 -23.00 2.21 2.93
175 r1 L1 g7 4 1495.20 10.17 -23.00 2.41 3.27
176 r4 L1 g7 4 1557.02 10.59 -23.00 2.45 3.33
177 r3 L3 g7 4 67.33 0.46 -101.66 0.38 0.98
178 r1 L3 g7 4 68.65 0.47 -101.66 0.38 0.98
179 r4 L3 g7 4 144.21 0.98 -101.66 0.68 1.22
180 r2 L3 g7 4 218.44 1.49 -101.66 0.91 1.41
181 r1 L2 g8 4 89.13 0.61 303.64 0.47 1.05
182 r4 L2 g8 4 198.80 1.35 303.64 0.86 1.36
183 r3 L2 g8 4 219.53 1.49 303.64 0.91 1.41
184 r2 L2 g8 4 419.58 2.85 303.64 1.35 1.83
185 r1 L1 g8 4 1346.10 9.16 -23.00 2.32 3.11
186 r3 L1 g8 4 1440.60 9.80 -23.00 2.38 3.21
187 r2 L1 g8 4 1638.42 11.15 -23.00 2.50 3.41
188 r4 L1 g8 4 1745.18 11.87 -23.00 2.56 3.52
189 r1 L3 g8 4 47.78 0.33 -101.66 0.28 0.91
190 r3 L3 g8 4 58.80 0.40 -101.66 0.34 0.95
191 r2 L3 g8 4 73.50 0.50 -101.66 0.41 1.00
192 r4 L3 g8 4 88.20 0.60 -101.66 0.47 1.05
193 r2 L2 g9 4 337.10 2.29 303.64 1.19 1.67
194 r3 L2 g9 4 391.23 2.66 303.64 1.30 1.78
195 r1 L2 g9 4 458.26 3.12 303.64 1.42 1.90
196 r4 L2 g9 4 554.75 3.77 303.64 1.56 2.07
197 r2 L1 g9 4 821.44 5.59 -23.00 1.89 2.47
198 r3 L1 g9 4 901.40 6.13 -23.00 1.96 2.58
199 r1 L1 g9 4 1008.42 6.86 -23.00 2.06 2.71
200 r4 L1 g9 4 1193.64 8.12 -23.00 2.21 2.94
201 r4 L3 g9 4 62.48 0.43 -101.66 0.35 0.96
202 r3 L3 g9 4 167.87 1.14 -101.66 0.76 1.28
203 r1 L3 g9 4 191.54 1.30 -101.66 0.83 1.34
204 r2 L3 g9 4 347.80 2.37 -101.66 1.21 1.69
> d2$ysq=d2$y^2
> library(reshape)
Error in library(reshape) : there is no package called ‘reshape’
> d3=rename(d2,c(t="time"))
Error: could not find function "rename"
> head(d2,n=6)
rep Location Genotype t yield y p ly sy ysq
1 r2 L2 g1 4 276.68 1.88 303.64 1.06 1.54 3.5344
2 r1 L2 g1 4 298.29 2.03 303.64 1.11 1.59 4.1209
3 r3 L2 g1 4 330.22 2.25 303.64 1.18 1.66 5.0625
4 r4 L2 g1 4 1234.98 8.40 303.64 2.24 2.98 70.5600
5 r1 L1 g1 4 813.89 5.54 -23.00 1.88 2.46 30.6916
6 r4 L1 g1 4 1065.75 7.25 -23.00 2.11 2.78 52.5625
> d4=d2[order(d3$yield),]
Error in order(d3$yield) : object 'd3' not found
> d4=d2[order(d2$yield),]
> d4yield
Error: object 'd4yield' not found
> head(d4,n=10)
rep Location Genotype t yield y p ly sy ysq
61 r4 L2 g14 4 0.00 0.00 303.64 0.00 0.71 0.0000
145 r2 L2 g5 4 0.00 0.00 303.64 0.00 0.71 0.0000
149 r2 L1 g5 4 0.00 0.00 -23.00 0.00 0.71 0.0000
150 r4 L1 g5 4 0.00 0.00 -23.00 0.00 0.71 0.0000
153 r4 L3 g5 4 23.52 0.16 -101.66 0.15 0.81 0.0256
157 r2 L2 g6 4 26.17 0.18 303.64 0.16 0.82 0.0324
154 r1 L3 g5 4 29.40 0.20 -101.66 0.18 0.84 0.0400
155 r3 L3 g5 4 34.25 0.23 -101.66 0.21 0.86 0.0529
85 r1 L2 g16 4 37.38 0.25 303.64 0.23 0.87 0.0625
21 r4 L3 g10 4 44.10 0.30 -101.66 0.26 0.89 0.0900
> d4=d2[-order(d2$yield),]
> head(d4,n=10)
[1] rep Location Genotype t yield y p ly
[9] sy ysq
<0 rows> (or 0-length row.names)
> tail(d4,n=10)
[1] rep Location Genotype t yield y p ly
[9] sy ysq
<0 rows> (or 0-length row.names)
> d4
[1] rep Location Genotype t yield y p ly
[9] sy ysq
<0 rows> (or 0-length row.names)
> d4=d2[order(d2$yield,decreasing =F),]
> head(d4,n=10)
rep Location Genotype t yield y p ly sy ysq
61 r4 L2 g14 4 0.00 0.00 303.64 0.00 0.71 0.0000
145 r2 L2 g5 4 0.00 0.00 303.64 0.00 0.71 0.0000
149 r2 L1 g5 4 0.00 0.00 -23.00 0.00 0.71 0.0000
150 r4 L1 g5 4 0.00 0.00 -23.00 0.00 0.71 0.0000
153 r4 L3 g5 4 23.52 0.16 -101.66 0.15 0.81 0.0256
157 r2 L2 g6 4 26.17 0.18 303.64 0.16 0.82 0.0324
154 r1 L3 g5 4 29.40 0.20 -101.66 0.18 0.84 0.0400
155 r3 L3 g5 4 34.25 0.23 -101.66 0.21 0.86 0.0529
85 r1 L2 g16 4 37.38 0.25 303.64 0.23 0.87 0.0625
21 r4 L3 g10 4 44.10 0.30 -101.66 0.26 0.89 0.0900
> d4=d2[order(d2$yield,decreasing =F),]
> head(d4,n=10)
rep Location Genotype t yield y p ly sy ysq
61 r4 L2 g14 4 0.00 0.00 303.64 0.00 0.71 0.0000
145 r2 L2 g5 4 0.00 0.00 303.64 0.00 0.71 0.0000
149 r2 L1 g5 4 0.00 0.00 -23.00 0.00 0.71 0.0000
150 r4 L1 g5 4 0.00 0.00 -23.00 0.00 0.71 0.0000
153 r4 L3 g5 4 23.52 0.16 -101.66 0.15 0.81 0.0256
157 r2 L2 g6 4 26.17 0.18 303.64 0.16 0.82 0.0324
154 r1 L3 g5 4 29.40 0.20 -101.66 0.18 0.84 0.0400
155 r3 L3 g5 4 34.25 0.23 -101.66 0.21 0.86 0.0529
85 r1 L2 g16 4 37.38 0.25 303.64 0.23 0.87 0.0625
21 r4 L3 g10 4 44.10 0.30 -101.66 0.26 0.89 0.0900
> d4=d2[order(d2$yield,decreasing =T),]
> head(d4,n=10)
rep Location Genotype t yield y p ly sy ysq
104 r3 L1 g2 4 2017.43 13.72 -23.00 2.69 3.77 188.2384
128 r4 L1 g3 4 2015.37 13.71 -23.00 2.69 3.77 187.9641
188 r4 L1 g8 4 1745.18 11.87 -23.00 2.56 3.52 140.8969
160 r1 L2 g6 4 1661.84 11.31 303.64 2.51 3.44 127.9161
187 r2 L1 g8 4 1638.42 11.15 -23.00 2.50 3.41 124.3225
176 r4 L1 g7 4 1557.02 10.59 -23.00 2.45 3.33 112.1481
175 r1 L1 g7 4 1495.20 10.17 -23.00 2.41 3.27 103.4289
8 r3 L1 g1 4 1494.99 10.17 -23.00 2.41 3.27 103.4289
140 r3 L1 g4 4 1467.80 9.99 -23.00 2.40 3.24 99.8001
186 r3 L1 g8 4 1440.60 9.80 -23.00 2.38 3.21 96.0400

d2=read.csv("C:\\Users\\Arab\\Desktop\\xdata.csv")

d2

d2$ysq=d2$y^2

d2

library(reshape)

d3=rename(d2,c(t="time"))

head(d2,n=6)

d4=d2[order(d2$yield),]

head(d4,n=10)

d4=d2[-order(d2$yield),]

d4
head(d4,n=10)

tail(d4,n=10)

d4=d2[order(d2$yield,decreasing =F),]

head(d4,n=10)

d4=d2[order(d2$yield,decreasing =T),]