Learn R Programming

partools (version 1.1.7)

parpdist: Partools Apps

Description

General parallel applications.

Usage

parpdist(x,y,cls)

Value

Object of type "pdist".

Arguments

cls

A cluster run under the parallel package.

x

A data matrix

y

A data matrix

Author

Norm Matloff

Details

Parallel wrapper for pdist from package of the same name. Finds all the distances from rows in x to rows in y.

Examples

Run this code
# set up 'parallel' cluster
cls <- makeCluster(2)
setclsinfo(cls)

x <- matrix(runif(20),nrow=5)
y <- matrix(runif(32),nrow=8)
# 2 calls should have identical resultsW
pdist(x,y,cls)@dist
parpdist(x,y,cls)@dist

stopCluster(cls)

Run the code above in your browser using DataLab