pairwise_dist.cordist: Compute Pairwise Correlation Distances

View source: R/distcalc.R

pairwise_dist.cordistR Documentation

Compute Pairwise Correlation Distances

Description

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 class '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)


bbuchsbaum/rMVPA documentation built on April 28, 2024, 6:30 a.m.