#beginCluster()
beginCluster(type="SOCK")
r <- raster()
r[] <- 1:ncell(r)
x <- clusterR(r, sqrt, verbose=T)
f1 <- function(x) calc(x, sqrt)
y <- clusterR(r, f1)
s <- stack(r, r*2, r*3)
f2 <- function(x) calc(x, range)
z <- clusterR(s, f2)
pts <- matrix(c(0,0, 45,45), ncol=2, byrow=T)
d <- clusterR(r, distanceFromPoints, args=list(xy=pts))
endCluster()
Run the code above in your browser using DataLab