Browse Source

first run complete

mxmehl 5 years ago
parent
commit
f9757f1a0a
4 changed files with 310 additions and 42 deletions
  1. 40
    40
      .Rhistory
  2. 2
    2
      issuecomp-analysis.R
  3. 268
    0
      issuecomp-analysis.log
  4. BIN
      matched-ids.tar

+ 40
- 40
.Rhistory View File

@@ -1,3 +1,14 @@
1
+require(stringr)
2
+library(foreach)
3
+library(doParallel)
4
+# MATCH TWEETS ------------------------------------------------------------
5
+id_folder <- "matched-ids"
6
+unlink(id_folder, recursive = TRUE)
7
+dir.create(id_folder)
8
+issues <- data.frame(date = drange)
9
+issuelist <- readLines("issues.xml")
10
+issuelist <- str_replace_all(string = issuelist, pattern = ".*<!-- .+ -->", "")
11
+issuelist <- xmlToList(issuelist)
1 12
 issueheads <- names(issuelist)
2 13
 issues[issueheads] <- 0
3 14
 tweets$issue <- ""
@@ -77,8 +88,6 @@ else {
77 88
 } # /for issuelist
78 89
 } # /for tweets_curday
79 90
 } # /for drange
80
-#rm(tweets_curday,curacro, curchars, curdate,curfile,curid,curissue,curtag,curtags,curtext,d,date_end,date_start,i,id_folder,oldissue,oldtag,s,t,tags_found)
81
-stopCluster(cl)
82 91
 require(lubridate)
83 92
 require(XML)
84 93
 require(ggplot2)
@@ -162,7 +171,7 @@ if(tags_found == TRUE) {
162 171
 #           tweets[tweets[, "id_str"] == curid, "tags"] <- str_c(oldtag, curtag, ";")
163 172
 # Add information to file for function viewPatternMatching
164 173
 write(str_c(curdate,";\"",curid,"\";",curissue,";",curtag), curfile, append = TRUE)
165
-cat(paste("Match!\n"), file="issuecomp-analysis.log", append=TRUE)
174
+#           cat(paste("Match!\n"), file="issuecomp-analysis.log", append=TRUE)
166 175
 #           data.frame(date=curdate, issue=curissue)
167 176
 break   # next issue, no more tags from same issue
168 177
 }
@@ -173,6 +182,11 @@ else {
173 182
 } # /for issuelist
174 183
 } # /for tweets_curday
175 184
 } # /for drange
185
+stopCluster(cl)
186
+drange
187
+drange[40]
188
+drange[50]
189
+View(issues)
176 190
 require(lubridate)
177 191
 require(XML)
178 192
 require(ggplot2)
@@ -180,24 +194,12 @@ require(reshape2)
180 194
 require(stringr)
181 195
 library(foreach)
182 196
 library(doParallel)
183
-# MATCH TWEETS ------------------------------------------------------------
184
-id_folder <- "matched-ids"
185
-unlink(id_folder, recursive = TRUE)
186
-dir.create(id_folder)
187
-issues <- data.frame(date = drange)
188
-issuelist <- readLines("issues.xml")
189
-issuelist <- str_replace_all(string = issuelist, pattern = ".*<!-- .+ -->", "")
190
-issuelist <- xmlToList(issuelist)
191
-issueheads <- names(issuelist)
192
-issues[issueheads] <- 0
193
-tweets$issue <- ""
194
-tweets$tags <- ""
195
-tagexpand <- c("", "s", "n", "en", "er", "e")
196
-# Parallelisation
197
-writeLines(c(""), "issuecomp-analysis.log")
197
+drange[70]
198
+drange[80]
199
+drange[90]
198 200
 cl<-makeCluster(4)
199 201
 registerDoParallel(cl)
200
-foreach(d = 1:nrow(issues), .packages = c("stringr"), .combine=rbind) %dopar% {
202
+foreach(d = 51:90, .packages = c("stringr"), .combine=rbind) %dopar% {
201 203
 #for(d in 1:nrow(issues)) {
202 204
 # Go through every day
203 205
 curdate <- issues$date[d]
@@ -267,24 +269,12 @@ else {
267 269
 } # /for issuelist
268 270
 } # /for tweets_curday
269 271
 } # /for drange
272
+#rm(tweets_curday,curacro, curchars, curdate,curfile,curid,curissue,curtag,curtags,curtext,d,date_end,date_start,i,id_folder,oldissue,oldtag,s,t,tags_found)
270 273
 stopCluster(cl)
271
-drange
272
-drange[40]
273
-drange[50]
274
-View(issues)
275
-require(lubridate)
276
-require(XML)
277
-require(ggplot2)
278
-require(reshape2)
279
-require(stringr)
280
-library(foreach)
281
-library(doParallel)
282
-drange[70]
283
-drange[80]
284
-drange[90]
274
+drange[121]
285 275
 cl<-makeCluster(4)
286 276
 registerDoParallel(cl)
287
-foreach(d = 51:90, .packages = c("stringr"), .combine=rbind) %dopar% {
277
+foreach(d = 91:120, .packages = c("stringr"), .combine=rbind) %dopar% {
288 278
 #for(d in 1:nrow(issues)) {
289 279
 # Go through every day
290 280
 curdate <- issues$date[d]
@@ -354,12 +344,18 @@ else {
354 344
 } # /for issuelist
355 345
 } # /for tweets_curday
356 346
 } # /for drange
357
-#rm(tweets_curday,curacro, curchars, curdate,curfile,curid,curissue,curtag,curtags,curtext,d,date_end,date_start,i,id_folder,oldissue,oldtag,s,t,tags_found)
358 347
 stopCluster(cl)
359
-drange[121]
348
+drange[102]
349
+require(lubridate)
350
+require(XML)
351
+require(ggplot2)
352
+require(reshape2)
353
+require(stringr)
354
+library(foreach)
355
+library(doParallel)
360 356
 cl<-makeCluster(4)
361 357
 registerDoParallel(cl)
362
-foreach(d = 91:120, .packages = c("stringr"), .combine=rbind) %dopar% {
358
+foreach(d = 101:nrow(issues), .packages = c("stringr"), .combine=rbind) %dopar% {
363 359
 #for(d in 1:nrow(issues)) {
364 360
 # Go through every day
365 361
 curdate <- issues$date[d]
@@ -429,8 +425,6 @@ else {
429 425
 } # /for issuelist
430 426
 } # /for tweets_curday
431 427
 } # /for drange
432
-stopCluster(cl)
433
-drange[102]
434 428
 require(lubridate)
435 429
 require(XML)
436 430
 require(ggplot2)
@@ -438,7 +432,7 @@ require(reshape2)
438 432
 require(stringr)
439 433
 library(foreach)
440 434
 library(doParallel)
441
-cl<-makeCluster(4)
435
+cl<-makeCluster(3)
442 436
 registerDoParallel(cl)
443 437
 foreach(d = 101:nrow(issues), .packages = c("stringr"), .combine=rbind) %dopar% {
444 438
 #for(d in 1:nrow(issues)) {
@@ -510,3 +504,9 @@ else {
510 504
 } # /for issuelist
511 505
 } # /for tweets_curday
512 506
 } # /for drange
507
+stopCluster(cl)
508
+drange[200]
509
+drange[300]
510
+drange[280]
511
+drange[270]
512
+drange[259]

+ 2
- 2
issuecomp-analysis.R View File

@@ -37,10 +37,10 @@ tagexpand <- c("", "s", "n", "en", "er", "e")
37 37
 
38 38
 # Parallelisation
39 39
 writeLines(c(""), "issuecomp-analysis.log")  
40
-cl<-makeCluster(3)
40
+cl<-makeCluster(4)
41 41
 registerDoParallel(cl)
42 42
 
43
-foreach(d = 101:nrow(issues), .packages = c("stringr"), .combine=rbind) %dopar% {
43
+foreach(d = 260:nrow(issues), .packages = c("stringr"), .combine=rbind) %dopar% {
44 44
 #for(d in 1:nrow(issues)) {
45 45
   # Go through every day
46 46
   curdate <- issues$date[d]

+ 268
- 0
issuecomp-analysis.log View File

@@ -108,3 +108,271 @@
108 108
 2014-04-13 
109 109
 2014-04-14 
110 110
 2014-04-15 
111
+2014-04-11 
112
+2014-04-12 
113
+2014-04-13 
114
+2014-04-14 
115
+2014-04-15 
116
+2014-04-16 
117
+2014-04-17 
118
+2014-04-18 
119
+2014-04-19 
120
+2014-04-20 
121
+2014-04-21 
122
+2014-04-22 
123
+2014-04-23 
124
+2014-04-24 
125
+2014-04-25 
126
+2014-04-26 
127
+2014-04-27 
128
+2014-04-28 
129
+2014-04-29 
130
+2014-04-30 
131
+2014-05-01 
132
+2014-05-02 
133
+2014-05-03 
134
+2014-05-04 
135
+2014-05-05 
136
+2014-05-06 
137
+2014-05-07 
138
+2014-05-08 
139
+2014-05-09 
140
+2014-05-10 
141
+2014-05-11 
142
+2014-05-12 
143
+2014-05-13 
144
+2014-05-14 
145
+2014-05-15 
146
+2014-05-16 
147
+2014-05-17 
148
+2014-05-18 
149
+2014-05-19 
150
+2014-05-20 
151
+2014-05-21 
152
+2014-05-22 
153
+2014-05-23 
154
+2014-05-24 
155
+2014-05-25 
156
+2014-05-26 
157
+2014-05-27 
158
+2014-05-28 
159
+2014-05-29 
160
+2014-05-30 
161
+2014-05-31 
162
+2014-06-01 
163
+2014-06-02 
164
+2014-06-03 
165
+2014-06-04 
166
+2014-06-05 
167
+2014-06-06 
168
+2014-06-07 
169
+2014-06-08 
170
+2014-06-09 
171
+2014-06-10 
172
+2014-06-11 
173
+2014-06-12 
174
+2014-06-13 
175
+2014-06-14 
176
+2014-06-15 
177
+2014-06-16 
178
+2014-06-17 
179
+2014-06-18 
180
+2014-06-19 
181
+2014-06-20 
182
+2014-06-21 
183
+2014-06-22 
184
+2014-06-23 
185
+2014-06-24 
186
+2014-06-25 
187
+2014-06-26 
188
+2014-06-27 
189
+2014-06-28 
190
+2014-06-29 
191
+2014-06-30 
192
+2014-07-01 
193
+2014-07-02 
194
+2014-07-03 
195
+2014-07-04 
196
+2014-07-05 
197
+2014-07-06 
198
+2014-07-07 
199
+2014-07-08 
200
+2014-07-09 
201
+2014-07-10 
202
+2014-07-11 
203
+2014-07-12 
204
+2014-07-13 
205
+2014-07-14 
206
+2014-07-15 
207
+2014-07-16 
208
+2014-07-17 
209
+2014-07-18 
210
+2014-07-19 
211
+2014-07-20 
212
+2014-07-21 
213
+2014-07-22 
214
+2014-07-23 
215
+2014-07-24 
216
+2014-07-25 
217
+2014-07-26 
218
+2014-07-27 
219
+2014-07-28 
220
+2014-07-29 
221
+2014-07-30 
222
+2014-07-31 
223
+2014-08-01 
224
+2014-08-02 
225
+2014-08-03 
226
+2014-08-04 
227
+2014-08-05 
228
+2014-08-06 
229
+2014-08-07 
230
+2014-08-08 
231
+2014-08-09 
232
+2014-08-10 
233
+2014-08-11 
234
+2014-08-12 
235
+2014-08-13 
236
+2014-08-14 
237
+2014-08-15 
238
+2014-08-16 
239
+2014-08-17 
240
+2014-08-18 
241
+2014-08-19 
242
+2014-08-20 
243
+2014-08-21 
244
+2014-08-22 
245
+2014-08-23 
246
+2014-08-24 
247
+2014-08-25 
248
+2014-08-26 
249
+2014-08-27 
250
+2014-08-28 
251
+2014-08-29 
252
+2014-08-30 
253
+2014-08-31 
254
+2014-09-01 
255
+2014-09-02 
256
+2014-09-03 
257
+2014-09-04 
258
+2014-09-05 
259
+2014-09-06 
260
+2014-09-07 
261
+2014-09-08 
262
+2014-09-09 
263
+2014-09-10 
264
+2014-09-11 
265
+2014-09-12 
266
+2014-09-13 
267
+2014-09-14 
268
+2014-09-15 
269
+2014-09-16 
270
+2014-09-17 
271
+2014-09-18 
272
+2014-09-19 
273
+2014-09-17 
274
+2014-09-18 
275
+2014-09-19 
276
+2014-09-20 
277
+2014-09-21 
278
+2014-09-22 
279
+2014-09-23 
280
+2014-09-24 
281
+2014-09-25 
282
+2014-09-26 
283
+2014-09-27 
284
+2014-09-28 
285
+2014-09-29 
286
+2014-09-30 
287
+2014-10-01 
288
+2014-10-02 
289
+2014-10-03 
290
+2014-10-04 
291
+2014-10-05 
292
+2014-10-06 
293
+2014-10-07 
294
+2014-10-08 
295
+2014-10-09 
296
+2014-10-10 
297
+2014-10-11 
298
+2014-10-12 
299
+2014-10-13 
300
+2014-10-14 
301
+2014-10-15 
302
+2014-10-16 
303
+2014-10-17 
304
+2014-10-18 
305
+2014-10-19 
306
+2014-10-20 
307
+2014-10-21 
308
+2014-10-22 
309
+2014-10-23 
310
+2014-10-24 
311
+2014-10-25 
312
+2014-10-26 
313
+2014-10-27 
314
+2014-10-28 
315
+2014-10-29 
316
+2014-10-30 
317
+2014-10-31 
318
+2014-11-01 
319
+2014-11-02 
320
+2014-11-03 
321
+2014-11-04 
322
+2014-11-05 
323
+2014-11-06 
324
+2014-11-07 
325
+2014-11-08 
326
+2014-11-09 
327
+2014-11-10 
328
+2014-11-11 
329
+2014-11-12 
330
+2014-11-13 
331
+2014-11-14 
332
+2014-11-15 
333
+2014-11-16 
334
+2014-11-17 
335
+2014-11-18 
336
+2014-11-19 
337
+2014-11-20 
338
+2014-11-21 
339
+2014-11-22 
340
+2014-11-23 
341
+2014-11-24 
342
+2014-11-25 
343
+2014-11-26 
344
+2014-11-27 
345
+2014-11-28 
346
+2014-11-29 
347
+2014-11-30 
348
+2014-12-01 
349
+2014-12-02 
350
+2014-12-03 
351
+2014-12-04 
352
+2014-12-05 
353
+2014-12-06 
354
+2014-12-07 
355
+2014-12-08 
356
+2014-12-09 
357
+2014-12-10 
358
+2014-12-11 
359
+2014-12-12 
360
+2014-12-13 
361
+2014-12-14 
362
+2014-12-15 
363
+2014-12-16 
364
+2014-12-17 
365
+2014-12-18 
366
+2014-12-19 
367
+2014-12-20 
368
+2014-12-21 
369
+2014-12-22 
370
+2014-12-23 
371
+2014-12-24 
372
+2014-12-25 
373
+2014-12-26 
374
+2014-12-27 
375
+2014-12-28 
376
+2014-12-29 
377
+2014-12-30 
378
+2014-12-31 

BIN
matched-ids.tar View File


Loading…
Cancel
Save