I've been trying to make a parallel process in windows; doSNOW states that it makes "SOCK" type clusters, which is also referred to as "socket cluster"; I've got a single cpu with 8 physical and 8 logical cores, which i often use in linux; I've been trying to run the code below but whenever I try the %dopar% option it gives me a NULL result; so I'm wondering if windows only works in parallel with multi-socket machines (which I don't have)
library(jsonlite)
library(doSNOW)
library(foreach)
library(dplyr)
claves <- c("I11D67", "I11D66", "I11D65", "I11D64", "I11D63", "I11D62",
"I11D61", "I11C69", "I11D79", "I11D78", "I11D77", "I11D76", "I11D75",
"I11D74", "I11D73", "I11D72", "I11D71", "I11C79", "I12C82", "I12C81",
"I11D89", "I11D88", "I11D87", "I11D86", "I11D85")
cl <- makeCluster(8)
registerDoSNOW(cl)
foreach(i = claves, .combine=rbind, .errorhandling = "remove") %do% {
url <- sprintf("http://www.beta.inegi.org.mx/app/api/buscador/busquedaTodos/%s_A/RANKING/es", i)
ea <- fromJSON(url)
ea %>% select(TITULO, CVE_UNICA, EDICION)
} -> results
stopCluster(cl)