ڷ HOME > ڷ > ڷ
 
[MIS̳] R ó code
15-10-14 10:45 928
 
## Ƽھ Ǵ Ƽ óϿ
install.packages("doParallel")
library(doParallel)
registerDoParallel(cores=4)
data <- data.frame( value=runif(NROW(LETTERS) * 2000), group=rep(LETTERS, 2000))
foreach(i=1:800) %dopar% { mean(big_data$value + 1) }
foreach(i=1:80000) %dopar% { mean(big_data$value + 1) }  ## ۾ μ Rscript 4 ǰ