inst/doc/README.R

## ------------------------------------------------------------------------
library(ddR)
useBackend(parallel,executors=2)

## ------------------------------------------------------------------------
a <- dmapply(function(x) { x }, rep(3,5))
collect(a)

## ------------------------------------------------------------------------
a

## ------------------------------------------------------------------------
b <- dmapply(function(x,y) { x + y }, a, 1:5,nparts=1)
b

## ------------------------------------------------------------------------
collect(b)

## ------------------------------------------------------------------------
addThenSubtract <- function(x,y,z) {
  x + y - z
}
c <- dmapply(addThenSubtract,a,b,MoreArgs=list(z=5))
collect(c)

## ------------------------------------------------------------------------
d <- dmapply(function(x) length(x),parts(a))
collect(d)

## ------------------------------------------------------------------------
e <- dmapply(function(x) length(x),parts(b))
collect(e)

## ----eval=FALSE----------------------------------------------------------
#  library(distributedR.ddR)

## ----eval=FALSE----------------------------------------------------------
#  useBackend(distributedR)

Try the ddR package in your browser

Any scripts or data that you put into this service are public.

ddR documentation built on May 29, 2017, 6:52 p.m.