distpar {amap}R Documentation

Parallelized Distance Matrix Computation

Description

This function computes and returns the distance matrix computed by using the specified distance measure to compute the distances between the rows of a data matrix.

Usage

distpar(x, method = "euclidean", nbproc = 2, diag = FALSE, upper = FALSE)

Arguments

x numeric matrix or (data frame). Distances between the rows of x will be computed.
method the distance measure to be used. This must be one of "euclidean", "maximum", "manhattan", "canberra", "binary", "pearson", "correlation" or "spearman". Any unambiguous substring can be given.
nbproc Integer, Number of subprocess for parallelization
diag logical value indicating whether the diagonal of the distance matrix should be printed by print.dist.
upper logical value indicating whether the upper triangle of the distance matrix should be printed by print.dist.

Value

An object of class "dist".

See Also

Dist

Examples

x <- matrix(rnorm(100), nrow=5)

## compute dist with 8 threads
distpar(x,nbproc=8)

## compute pearson dist with 8 threads
distpar(x,nbproc=8,method="pearson")


[Package amap version 0.4-2 Index]