-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrscratchpad
More file actions
300 lines (293 loc) · 18.8 KB
/
Copy pathrscratchpad
File metadata and controls
300 lines (293 loc) · 18.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
# This is my first attempt
data = read.csv("output.csv")
data
data[rowSums(is.na(data)) == 0,]
data[rowSums(is.na(data)) == 0,]
data[rowSums(is.na(data)) == 0]
data[rowSums(is.na(data)) == 0,]
clean = data[rowSums(is.na(data)) == 0,]
clean
clean[2]
clean[3]
aggregate(clean[3], by=clean[2], FUN=mean
)
aggregate(clean[3], by=clean[2], FUN=mean)
aggregate(clean[3], by=(clean[2],clean[1]), FUN=mean)
aggregate(clean[3], by=list(clean[2],clean[1]), FUN=mean)
aggregate(clean[3], by=clean[1], FUN=mean)
aggregate(clean[3], by=clean$query.type, FUN=mean)
aggregate(clean[3], by=(clean$query.type), FUN=mean)
clean$query.type
list(clean$query.type)
clean$query.type
clean[1]
aggregate(clean[3], by=(clean[1]), FUN=mean)
clean$query
clean$query.description
aggregate(clean[3], by=list(clean[1]), FUN=mean)
aggregate(clean[3], by=list(clean$query.description), FUN=mean)
aggregate(clean[3] * clean[5], by=list(clean$query.description), FUN=mean)
clean[5]
aggregate(clean[3] * clean[5], by=list(clean$query.description), FUN=mean)
aggregate(clean[3] * clean[5], by=list(clean$query.description,clean$query.type), FUN=mean)
data
clean
aggregate(clean[3] * clean[5], by=list(clean$query.description,clean$query.type), FUN=mean)
data
clean
clean = data[rowSums(is.na(data)) == 0,]
clean
data
data[rowSums(is.na(data)) == 0,]
data[!(is.na(data[,3]))]
data[!(is.na(data[,3])),]
clean = data[!(is.na(data[,3])),]
aggregate(clean[3] * clean[5], by=list(clean$query.description,clean$query.type), FUN=mean)
ag = aggregate(clean[3] * clean[5], by=list(clean$query.description,clean$query.type), FUN=mean)
ag = aggregate(clean[3] * clean[5], by=list(clean$query.description,clean$query.type), FUN=mean, na.rm=TRUE)
ag
ag = aggregate(data[3] * data[5], by=list(data$query.description,data$query.type), FUN=mean, na.rm=TRUE)
ag
ag = aggregate(data$query.duration * data$count, by=list(data$query.description,data$query.type), FUN=mean, na.rm=TRUE)
ag
ag
tmPlot ag
tmPlot(ag)
ggplot(ag)
plot.table
plot.table(ag)
plot(ag)
ag
graph
tableplot
latex
latex
module
latex(ag)
xtable
plot(ag, type = "h")
plot(ag, type = "h")
plot(ag)
plot.table(ag)
plot(table(ag))
# Plotting things
merged = read.csv("merged.csv")
head(merged)
summary(with(x[with(x,query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))
summary(with(x[with(x,query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))
summary(with(x[with(x,query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))
head(x)
head(merged)
summary(with(merged[with(merged,query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))
summary(with(x[with(x,query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))
plot(with(x[with(x,query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))
x
plot(density(log(with(x[with(x,query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))))
summary(with(x[with(x,query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))
summary(density(log(with(x[with(x,query.description=="tag_polite" & query.type=="complete"),],rep(query.duration,times=count)))))
x = x[!is.na(x$query.duration),]
summary(density(log(with(x[with(x,query.description=="tag_polite" & query.type=="complete"),],rep(query.duration,times=count)))))
summary(with(x[with(x,query.description=="tag_polite" & query.type=="complete"),],rep(query.duration,times=count)))
summary(with(x[with(x,query.description=="tag_polite" & query.type=="complete"),],rep(query.duration,times=count)))
summary(with(x[with(x,query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))
plot(density(log(with(x[with(x,query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))))
lines(density(log(with(x[with(x,query.description=="tag_polite" & query.type=="complete"),],rep(query.duration,times=count)))))
plot(density(log(with(x[with(x,query.description=="tag_polite" & query.type=="complete"),],rep(query.duration,times=count)))))
plot(density(log(with(x[with(x,query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))))
plot(density(log(with(x[with(x,query.description=="tag_ynode" & query.type=="complete"),],rep(query.duration,times=count)))))
plot(density(log(with(x[with(x,query.description=="tag_polite" & query.type=="complete"),],rep(query.duration,times=count)))))
y = na.omit(x)
plot(density(log(with(y[with(y,query.description=="tag_polite" & query.type=="complete"),],rep(query.duration,times=count)))))
x = read.csv("~/xaaaap.csv")
plot(density(log(with(y[with(y,query.description=="tag_polite" & query.type=="complete"),],rep(query.duration,times=count)))))
x = x[!is.na(x$query.duration),]
plot(density(log(with(y[with(y,query.description=="tag_polite" & query.type=="complete"),],rep(query.duration,times=count)))))
summary(with(y[with(y,query.description=="tag_polite" & query.type=="complete"),],rep(query.duration,times=count)))
x = read.csv("~/merged.csv")
x = read.csv("merged.csv")
head(x)
summary(with(x[with(x,query.description=="tag_polite" & query.type=="complete"),],rep(query.duration,times=count)))
head(x)
x = read.csv("merged.csv")
head(x)
summary(with(x[with(x,query.description=="tag_polite" & query.type=="complete"),],rep(query.duration,times=count)))
summary(with(x[with(x,query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))
x = read.csv("merged.csv")
plot(density(log(with(x[with(x,query.description=="tag_polite" & query.type=="complete"),],rep(query.duration,times=count)))))
summary(with(x[with(x,query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))
plot(density(log(with(x[with(x,query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))))
lines(density(log(with(x[with(x,query.description=="tag_polite" & query.type=="complete"),],rep(query.duration,times=count)))))
summary(with(x[with(x,query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))
summary(with(x[with(x,query.description=="tag_polite" & query.type=="complete"),],rep(query.duration,times=count)))
abline(447)
abline(v=log(447))
abline(v=log(2384))
par(col.lab="red")
par(col.lab="red")
plot(density(log(with(x[with(x,query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))))
plot(density(log(with(x[with(x,query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))), col.lab="red")
plot(density(log(with(x[with(x,query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))), col.lab="blue")
plot(density(log(with(x[with(x,query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))), col.lab="red")
plot(density(log(with(x[with(x,query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))), col="red")
lines(density(log(with(x[with(x,query.description=="tag_polite" & query.type=="complete"),],rep(query.duration,times=count)))), col="blue")
abline(v=log(447), col="red")
abline(v=log(2384), col="blue")
# for i in *.fixed; do cat $i | ruby ../../count.rb -c -e 'query.type, query.description, query.duration, placement_id, country, dma, speed, browser, platform' > $i.csv; done
merged = read.csv("merged.csv")
head(merged)
summary(with(x[with(x,query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))
summary(with(x[with(x,query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))
summary(with(x[with(x,query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))
head(x)
head(merged)
summary(with(merged[with(merged,query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))
summary(with(x[with(x,query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))
plot(with(x[with(x,query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))
x
plot(density(log(with(x[with(x,query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))))
summary(with(x[with(x,query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))
summary(density(log(with(x[with(x,query.description=="tag_polite" & query.type=="complete"),],rep(query.duration,times=count)))))
x = x[!is.na(x$query.duration),]
summary(density(log(with(x[with(x,query.description=="tag_polite" & query.type=="complete"),],rep(query.duration,times=count)))))
summary(with(x[with(x,query.description=="tag_polite" & query.type=="complete"),],rep(query.duration,times=count)))
summary(with(x[with(x,query.description=="tag_polite" & query.type=="complete"),],rep(query.duration,times=count)))
summary(with(x[with(x,query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))
plot(density(log(with(x[with(x,query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))))
lines(density(log(with(x[with(x,query.description=="tag_polite" & query.type=="complete"),],rep(query.duration,times=count)))))
plot(density(log(with(x[with(x,query.description=="tag_polite" & query.type=="complete"),],rep(query.duration,times=count)))))
plot(density(log(with(x[with(x,query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))))
plot(density(log(with(x[with(x,query.description=="tag_ynode" & query.type=="complete"),],rep(query.duration,times=count)))))
plot(density(log(with(x[with(x,query.description=="tag_polite" & query.type=="complete"),],rep(query.duration,times=count)))))
y = na.omit(x)
plot(density(log(with(y[with(y,query.description=="tag_polite" & query.type=="complete"),],rep(query.duration,times=count)))))
x = read.csv("~/xaaaap.csv")
plot(density(log(with(y[with(y,query.description=="tag_polite" & query.type=="complete"),],rep(query.duration,times=count)))))
x = x[!is.na(x$query.duration),]
plot(density(log(with(y[with(y,query.description=="tag_polite" & query.type=="complete"),],rep(query.duration,times=count)))))
summary(with(y[with(y,query.description=="tag_polite" & query.type=="complete"),],rep(query.duration,times=count)))
x = read.csv("~/merged.csv")
x = read.csv("merged.csv")
head(x)
summary(with(x[with(x,query.description=="tag_polite" & query.type=="complete"),],rep(query.duration,times=count)))
head(x)
x = read.csv("merged.csv")
head(x)
summary(with(x[with(x,query.description=="tag_polite" & query.type=="complete"),],rep(query.duration,times=count)))
summary(with(x[with(x,query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))
x = read.csv("merged.csv")
plot(density(log(with(x[with(x,query.description=="tag_polite" & query.type=="complete"),],rep(query.duration,times=count)))))
summary(with(x[with(x,query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))
plot(density(log(with(x[with(x,query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))))
lines(density(log(with(x[with(x,query.description=="tag_polite" & query.type=="complete"),],rep(query.duration,times=count)))))
summary(with(x[with(x,query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))
summary(with(x[with(x,query.description=="tag_polite" & query.type=="complete"),],rep(query.duration,times=count)))
abline(447)
abline(v=log(447))
abline(v=log(2384))
par(col.lab="red")
par(col.lab="red")
plot(density(log(with(x[with(x,query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))))
plot(density(log(with(x[with(x,query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))), col.lab="red")
plot(density(log(with(x[with(x,query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))), col.lab="blue")
plot(density(log(with(x[with(x,query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))), col.lab="red")
plot(density(log(with(x[with(x,query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))), col="red")
lines(density(log(with(x[with(x,query.description=="tag_polite" & query.type=="complete"),],rep(query.duration,times=count)))), col="blue")
abline(v=log(447), col="red")
abline(v=log(2384), col="blue")
# Tables
x = read.csv("cd.csv")
DT
help("INSTALL")
install
package
package.install
INSTALL
help("INSTALL")
install.packages
install.packages('data.table')
data.table
package(data.table)
data.table
DT
DT[]
library(data.table)
dt
DT
dt
data.table
DT <- as.data.table(x)
DT
aggregate(x$query.duration, by=list(x$speed), fun=mean)
aggregate(x$query.duration, by=list(x$speed), FUN=mean)
x = x[!is.na(x$query.duration),]
aggregate(x$query.duration, by=list(x$speed), FUN=mean)
aggregate(x$query.duration, by=list(x$speed), FUN=median)
aggregate(x$query.duration, by=list(x$dma), FUN=median)
aggregate(x$query.duration, by=list(x$country), FUN=median)
head(x[x$speed=="dsl",])
head(with(x,speed=="dsl"))
head(x[with(x,speed=="dsl"),])
x[with(x,speed=="dsl"),]
aggregate(x$query.duration, by=list(x$speed), FUN=median)
x[with(x,speed=="xdsl"),]
summary(with(x[with(x,speed=="dsl" & query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))
summary(with(x[with(x,speed=="xdsl" & query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))
summary(with(x[with(x,speed=="xdsl" & query.description=="tag_polite" & query.type=="complete"),],rep(query.duration,times=count)))
summary(with(x[with(x,speed=="dialup" & query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))
summary(with(x[with(x,speed=="dialup" & query.description=="tag_polite" & query.type=="complete"),],rep(query.duration,times=count)))
summary(with(x[with(x,speed=="cable" & query.description=="tag_polite" & query.type=="complete"),],rep(query.duration,times=count)))
summary(with(x[with(x,speed=="cable" & query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))
aggregate(x$query.duration, by=list(x$speed), FUN=median)
summary(with(x[with(x,speed=="mobile" & query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))
summary(with(x[with(x,speed=="mobile" & query.description=="tag_polite" & query.type=="complete"),],rep(query.duration,times=count)))
summary(with(x[with(x,speed=="broadband" & query.description=="tag_polite" & query.type=="complete"),],rep(query.duration,times=count)))
summary(with(x[with(x,speed=="broadband" & query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))
summary(with(x[with(x,speed=="wireless" & query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))
summary(with(x[with(x,speed=="wireless" & query.description=="tag_polite" & query.type=="complete"),],rep(query.duration,times=count)))
summary(with(x[with(x,speed=="satelite" & query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))
aggregate(x$query.count, by=list(x$speed), FUN=sum)
aggregate(x$count, by=list(x$speed), FUN=sum)
summary(with(x[with(x,speed=="t1" & query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)))
summary(with(x[with(x,speed=="t1" & query.description=="tag_polite" & query.type=="complete"),],rep(query.duration,times=count)))
head(x[with(x,speed=="t1" & query.description=="tag_polite" & query.type=="complete"),])
head(x[with(x,query.description=="tag_polite" & query.type=="complete"),])
polite_completes = x[with(x,query.description=="tag_polite" & query.type=="complete"),]
aggregate(polite_completes$count, by=list(polite_completes$speed), FUN=sum)
dynode_completes = x[with(x,query.description=="tag_dynode" & query.type=="complete"),]
aggregate(dynode_completes$count, by=list(dynode_completes$speed), FUN=sum)
tag_starts = x[with(x,query.description=="tag_init" & query.type=="start"),]
aggregate(tag_starts$count, by=list(tag_starts$speed), FUN=sum)
aggregate(tag_starts$count, by=list(tag_starts$dma), FUN=sum)
aggregate(dynode_completes$count, by=list(dynode_completes$dma), FUN=sum)
aggregate(polite_completes$count, by=list(polite_completes$dma), FUN=sum)
aggregate(polite_completes$query.duration, by=list(polite_completes$dma), FUN=sum, times=list(polite_completes($count))
aggregate(polite_completes$query.duration, by=list(polite_completes$dma), FUN=sum, times=list(polite_completes$count))
aggregate(polite_completes$query.duration, by=list(polite_completes$dma), FUN=sum)
aggregate(polite_completes$query.duration, by=list(polite_completes$dma), FUN=mean)
aggregate(polite_completes$query.duration, by=list(polite_completes$dma), FUN=median)
with(x[with(x,speed=="xdsl" & query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count)
)
with(x[with(x,speed=="xdsl" & query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count))
durations = with(x[with(x,query.description=="tag_polite" & query.type=="complete"),],rep(query.duration,times=count))
dmas = with(x[with(x,query.description=="tag_polite" & query.type=="complete"),],rep(dma,times=count))
aggregate(durations, by=dmas, FUN=median)
aggregate(durations, by=list(dmas), FUN=median)
durations = with(x[with(x,query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count))
aggregate(durations, by=list(dmas), FUN=median)
dmas = with(x[with(x,query.description=="tag_dynode" & query.type=="complete"),],rep(dma,times=count))
aggregate(durations, by=list(dmas), FUN=median)
speeds = with(x[with(x,query.description=="tag_dynode" & query.type=="complete"),],rep(speed,times=count))
durations = with(x[with(x,query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count))
aggregate(durations, by=list(speeds), FUN=median)
durations = with(x[with(x,query.description=="tag_polite" & query.type=="complete"),],rep(query.duration,times=count))
speeds = with(x[with(x,query.description=="tag_polite" & query.type=="complete"),],rep(speed,times=count))
aggregate(durations, by=list(speeds), FUN=median)
aggregate(durations, by=list(speeds), FUN=quantile)
dmas = with(x[with(x,query.description=="tag_dynode" & query.type=="complete"),],rep(dma,times=count))
durations = with(x[with(x,query.description=="tag_dynode" & query.type=="complete"),],rep(query.duration,times=count))
aggregate(durations, by=list(dmas), FUN=quantile)
dmas = with(x[with(x,query.description=="tag_polite" & query.type=="complete"),],rep(dma,times=count))
durations = with(x[with(x,query.description=="tag_polite" & query.type=="complete"),],rep(query.duration,times=count))
aggregate(durations, by=list(dmas), FUN=quantile)
savehistory
savehistory()