## Not run:
# restoreResults <- TRUE
#
# sfInit(parallel=FALSE)
#
# ## Execute in cluster or sequential.
# sfLapply(1:10, exp)
#
# ## Execute with intermediate result saving and restore on wish.
# sfClusterApplySR(1:100, exp, name="CALC_EXP", restore=restoreResults)
# sfClusterApplySR(1:100, sum, name="CALC_SUM", restore=restoreResults)
#
# sfStop()
#
# ##
# ## Small bootstrap example.
# ##
# sfInit(parallel=TRUE, cpus=2)
#
# require(mvna)
# data(sir.adm)
#
# sfExport("sir.adm", local=FALSE)
# sfLibrary(cmprsk)
#
# wrapper <- function(a) {
# index <- sample(1:nrow(sir.adm), replace=TRUE)
# temp <- sir.adm[index, ]
# fit <- crr(temp$time, temp$status, temp$pneu, failcode=1, cencode=0)
# return(fit$coef)
# }
#
# result <- sfLapply(1:100, wrapper)
#
# mean( unlist( rbind( result ) ) )
# sfStop()
# ## End(Not run)
Run the code above in your browser using DataLab