Skip to contents

This method computes the pairwise correlation distances for a matrix `X`, excluding comparisons within the same block as specified by the `dist_obj$block`.

Usage

# S3 method for cordist
pairwise_dist(obj, X)

Arguments

X

Numeric matrix where rows represent observations and columns represent variables.

dist_obj

A list containing the method ("correlation") and a block vector to specify which rows in `X` should not be compared to avoid within-block correlation.

Value

An object of class `dist` containing the computed correlation distances.

Examples

X <- matrix(rnorm(100), 10, 10)
block <- rep(1:2, each=5)
dist_obj <- list(method = "pearson", block = block)
dist_matrix <- pairwise_dist.correlation(dist_obj, X)
#> Error in pairwise_dist.correlation(dist_obj, X): could not find function "pairwise_dist.correlation"