library("doParallel") library("foreach") cluster <- makeCluster(7) registerDoParallel(cluster) r <- 1 v <- c(1,1) inA <- function(x) sum((x-v)^2)