Skip to content

Instantly share code, notes, and snippets.

@josefslerka
Created July 29, 2015 18:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josefslerka/668884d9df30c5d26f56 to your computer and use it in GitHub Desktop.
Save josefslerka/668884d9df30c5d26f56 to your computer and use it in GitHub Desktop.
library(parallel)
dfUsers <- read.csv("xxx_users.csv")
x <- cbind(x = as.vector(dfUsers$name))
numWorkers <- 8
Sys.time()
res <- mclapply(x, whatGender,mc.cores = numWorkers)
Sys.time()
dfGender <-do.call("rbind", res)
Sys.time()
dfUsers <- merge(dfUsers, dfGender, by="name")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment