Nothing
## ---- echo = FALSE, message = FALSE, warning = FALSE--------------------------
library(ParallelLogger)
## -----------------------------------------------------------------------------
cluster <- makeCluster(numberOfThreads = 3)
## -----------------------------------------------------------------------------
fun <- function(x, constant) {
return(x * constant)
}
## -----------------------------------------------------------------------------
x <- 1:3
clusterApply(cluster, x, fun, constant = 2)
## -----------------------------------------------------------------------------
doBigJob <- function(largeVector) {
doTinyJob <- function(x){
return(x^2)
}
cluster <- makeCluster(numberOfThreads = 3)
clusterApply(cluster, largeVector, doTinyJob)
stopCluster(cluster)
}
## -----------------------------------------------------------------------------
doTinyJob <- function(x){
return(x^2)
}
doBigJob <- function(largeVector) {
cluster <- makeCluster(numberOfThreads = 3)
clusterApply(cluster, largeVector, doTinyJob)
stopCluster(cluster)
}
## -----------------------------------------------------------------------------
stopCluster(cluster)
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.