first tests with parallel

This commit is contained in:
2015-02-22 02:50:01 +01:00
parent 2f37abab85
commit b3658e282a
+8 -1
View File
@@ -33,9 +33,16 @@ tweets$tags <- ""
tagexpand <- c("", "s", "n", "en", "er")
for(d in 1:nrow(issues)) {
# Parallelisation
writeLines(c(""), "log.txt")
cl<-makeCluster(3)
registerDoParallel(cl)
df<-foreach(d = 1:nrow(issues) %dopar% {
#for(d in 1:nrow(issues)) {
# Go through every day
curdate <- issues$date[d]
sink("log.txt", append=TRUE)
cat(as.character(curdate),"\n")
# Put all tweets from specific day in a temporary DF