first run complete

master
mxmehl 8 years ago
parent eaffcf3db2
commit f9757f1a0a

@ -1,3 +1,14 @@
require(stringr)
library(foreach)
library(doParallel)
# MATCH TWEETS ------------------------------------------------------------
id_folder <- "matched-ids"
unlink(id_folder, recursive = TRUE)
dir.create(id_folder)
issues <- data.frame(date = drange)
issuelist <- readLines("issues.xml")
issuelist <- str_replace_all(string = issuelist, pattern = ".*<!-- .+ -->", "")
issuelist <- xmlToList(issuelist)
issueheads <- names(issuelist)
issues[issueheads] <- 0
tweets$issue <- ""
@ -77,8 +88,6 @@ else {
} # /for issuelist
} # /for tweets_curday
} # /for drange
#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)
stopCluster(cl)
require(lubridate)
require(XML)
require(ggplot2)
@ -162,7 +171,7 @@ if(tags_found == TRUE) {
# tweets[tweets[, "id_str"] == curid, "tags"] <- str_c(oldtag, curtag, ";")
# Add information to file for function viewPatternMatching
write(str_c(curdate,";\"",curid,"\";",curissue,";",curtag), curfile, append = TRUE)
cat(paste("Match!\n"), file="issuecomp-analysis.log", append=TRUE)
# cat(paste("Match!\n"), file="issuecomp-analysis.log", append=TRUE)
# data.frame(date=curdate, issue=curissue)
break # next issue, no more tags from same issue
}
@ -173,6 +182,11 @@ else {
} # /for issuelist
} # /for tweets_curday
} # /for drange
stopCluster(cl)
drange
drange[40]
drange[50]
View(issues)
require(lubridate)
require(XML)
require(ggplot2)
@ -180,24 +194,12 @@ require(reshape2)
require(stringr)
library(foreach)
library(doParallel)
# MATCH TWEETS ------------------------------------------------------------
id_folder <- "matched-ids"
unlink(id_folder, recursive = TRUE)
dir.create(id_folder)
issues <- data.frame(date = drange)
issuelist <- readLines("issues.xml")
issuelist <- str_replace_all(string = issuelist, pattern = ".*<!-- .+ -->", "")
issuelist <- xmlToList(issuelist)
issueheads <- names(issuelist)
issues[issueheads] <- 0
tweets$issue <- ""
tweets$tags <- ""
tagexpand <- c("", "s", "n", "en", "er", "e")
# Parallelisation
writeLines(c(""), "issuecomp-analysis.log")
drange[70]
drange[80]
drange[90]
cl<-makeCluster(4)
registerDoParallel(cl)
foreach(d = 1:nrow(issues), .packages = c("stringr"), .combine=rbind) %dopar% {
foreach(d = 51:90, .packages = c("stringr"), .combine=rbind) %dopar% {
#for(d in 1:nrow(issues)) {
# Go through every day
curdate <- issues$date[d]
@ -267,24 +269,12 @@ else {
} # /for issuelist
} # /for tweets_curday
} # /for drange
#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)
stopCluster(cl)
drange
drange[40]
drange[50]
View(issues)
require(lubridate)
require(XML)
require(ggplot2)
require(reshape2)
require(stringr)
library(foreach)
library(doParallel)
drange[70]
drange[80]
drange[90]
drange[121]
cl<-makeCluster(4)
registerDoParallel(cl)
foreach(d = 51:90, .packages = c("stringr"), .combine=rbind) %dopar% {
foreach(d = 91:120, .packages = c("stringr"), .combine=rbind) %dopar% {
#for(d in 1:nrow(issues)) {
# Go through every day
curdate <- issues$date[d]
@ -354,12 +344,18 @@ else {
} # /for issuelist
} # /for tweets_curday
} # /for drange
#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)
stopCluster(cl)
drange[121]
drange[102]
require(lubridate)
require(XML)
require(ggplot2)
require(reshape2)
require(stringr)
library(foreach)
library(doParallel)
cl<-makeCluster(4)
registerDoParallel(cl)
foreach(d = 91:120, .packages = c("stringr"), .combine=rbind) %dopar% {
foreach(d = 101:nrow(issues), .packages = c("stringr"), .combine=rbind) %dopar% {
#for(d in 1:nrow(issues)) {
# Go through every day
curdate <- issues$date[d]
@ -429,8 +425,6 @@ else {
} # /for issuelist
} # /for tweets_curday
} # /for drange
stopCluster(cl)
drange[102]
require(lubridate)
require(XML)
require(ggplot2)
@ -438,7 +432,7 @@ require(reshape2)
require(stringr)
library(foreach)
library(doParallel)
cl<-makeCluster(4)
cl<-makeCluster(3)
registerDoParallel(cl)
foreach(d = 101:nrow(issues), .packages = c("stringr"), .combine=rbind) %dopar% {
#for(d in 1:nrow(issues)) {
@ -510,3 +504,9 @@ else {
} # /for issuelist
} # /for tweets_curday
} # /for drange
stopCluster(cl)
drange[200]
drange[300]
drange[280]
drange[270]
drange[259]

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

@ -108,3 +108,271 @@
2014-04-13
2014-04-14
2014-04-15
2014-04-11
2014-04-12
2014-04-13
2014-04-14
2014-04-15
2014-04-16
2014-04-17
2014-04-18
2014-04-19
2014-04-20
2014-04-21
2014-04-22
2014-04-23
2014-04-24
2014-04-25
2014-04-26
2014-04-27
2014-04-28
2014-04-29
2014-04-30
2014-05-01
2014-05-02
2014-05-03
2014-05-04
2014-05-05
2014-05-06
2014-05-07
2014-05-08
2014-05-09
2014-05-10
2014-05-11
2014-05-12
2014-05-13
2014-05-14
2014-05-15
2014-05-16
2014-05-17
2014-05-18
2014-05-19
2014-05-20
2014-05-21
2014-05-22
2014-05-23
2014-05-24
2014-05-25
2014-05-26
2014-05-27
2014-05-28
2014-05-29
2014-05-30
2014-05-31
2014-06-01
2014-06-02
2014-06-03
2014-06-04
2014-06-05
2014-06-06
2014-06-07
2014-06-08
2014-06-09
2014-06-10
2014-06-11
2014-06-12
2014-06-13
2014-06-14
2014-06-15
2014-06-16
2014-06-17
2014-06-18
2014-06-19
2014-06-20
2014-06-21
2014-06-22
2014-06-23
2014-06-24
2014-06-25
2014-06-26
2014-06-27
2014-06-28
2014-06-29
2014-06-30
2014-07-01
2014-07-02
2014-07-03
2014-07-04
2014-07-05
2014-07-06
2014-07-07
2014-07-08
2014-07-09
2014-07-10
2014-07-11
2014-07-12
2014-07-13
2014-07-14
2014-07-15
2014-07-16
2014-07-17
2014-07-18
2014-07-19
2014-07-20
2014-07-21
2014-07-22
2014-07-23
2014-07-24
2014-07-25
2014-07-26
2014-07-27
2014-07-28
2014-07-29
2014-07-30
2014-07-31
2014-08-01
2014-08-02
2014-08-03
2014-08-04
2014-08-05
2014-08-06
2014-08-07
2014-08-08
2014-08-09
2014-08-10
2014-08-11
2014-08-12
2014-08-13
2014-08-14
2014-08-15
2014-08-16
2014-08-17
2014-08-18
2014-08-19
2014-08-20
2014-08-21
2014-08-22
2014-08-23
2014-08-24
2014-08-25
2014-08-26
2014-08-27
2014-08-28
2014-08-29
2014-08-30
2014-08-31
2014-09-01
2014-09-02
2014-09-03
2014-09-04
2014-09-05
2014-09-06
2014-09-07
2014-09-08
2014-09-09
2014-09-10
2014-09-11
2014-09-12
2014-09-13
2014-09-14
2014-09-15
2014-09-16
2014-09-17
2014-09-18
2014-09-19
2014-09-17
2014-09-18
2014-09-19
2014-09-20
2014-09-21
2014-09-22
2014-09-23
2014-09-24
2014-09-25
2014-09-26
2014-09-27
2014-09-28
2014-09-29
2014-09-30
2014-10-01
2014-10-02
2014-10-03
2014-10-04
2014-10-05
2014-10-06
2014-10-07
2014-10-08
2014-10-09
2014-10-10
2014-10-11
2014-10-12
2014-10-13
2014-10-14
2014-10-15
2014-10-16
2014-10-17
2014-10-18
2014-10-19
2014-10-20
2014-10-21
2014-10-22
2014-10-23
2014-10-24
2014-10-25
2014-10-26
2014-10-27
2014-10-28
2014-10-29
2014-10-30
2014-10-31
2014-11-01
2014-11-02
2014-11-03
2014-11-04
2014-11-05
2014-11-06
2014-11-07
2014-11-08
2014-11-09
2014-11-10
2014-11-11
2014-11-12
2014-11-13
2014-11-14
2014-11-15
2014-11-16
2014-11-17
2014-11-18
2014-11-19
2014-11-20
2014-11-21
2014-11-22
2014-11-23
2014-11-24
2014-11-25
2014-11-26
2014-11-27
2014-11-28
2014-11-29
2014-11-30
2014-12-01
2014-12-02
2014-12-03
2014-12-04
2014-12-05
2014-12-06
2014-12-07
2014-12-08
2014-12-09
2014-12-10
2014-12-11
2014-12-12
2014-12-13
2014-12-14
2014-12-15
2014-12-16
2014-12-17
2014-12-18
2014-12-19
2014-12-20
2014-12-21
2014-12-22
2014-12-23
2014-12-24
2014-12-25
2014-12-26
2014-12-27
2014-12-28
2014-12-29
2014-12-30
2014-12-31

Binary file not shown.
Loading…
Cancel
Save