From b3658e282a73edcdedcbbb15747bd9d04436ecec Mon Sep 17 00:00:00 2001 From: mxmehl Date: Sun, 22 Feb 2015 02:50:01 +0100 Subject: [PATCH] first tests with parallel --- issuecomp-analysis.R | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/issuecomp-analysis.R b/issuecomp-analysis.R index 7724579..a9a12be 100644 --- a/issuecomp-analysis.R +++ b/issuecomp-analysis.R @@ -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