Learn R Programming

raster (version 1.8-3)

Cluster: Use a multi-core (snow) cluster

Description

Create or delete a 'snow' cluster object. This object provides _experimental_ support for multi-core computing with a few 'raster' functions that support it. beginCluster creates the cluster object. It determines the number of nodes (cores) that are available and uses all of them (unless the argument n is used). endCluster closes the cluster and removes the object. The use of the cluster by functions is automatic, but has only been implemented in a few functions.

Usage

beginCluster(n, type)
endCluster()

Arguments

n
Integer. The number of nodes to be used (optional)
type
Character. The cluster type to be used (optional)

Value

  • None. The side effect is to create or delete a cluster object.

Details

Functions that are 'cluster-enabled' are: projectRaster, resample, distance. For progamming functions see getCluster, returnCluster

Examples

Run this code
beginCluster()

r <- raster(ncol=36, nrow=18)
r[] <- NA
r[500] <- 1
dist <- distance(r) 

endCluster()

Run the code above in your browser using DataLab