pairwise_dist.cordist | R Documentation |
This method computes the pairwise correlation distances for a matrix 'X', excluding comparisons within the same block as specified by the 'dist_obj$block'.
## S3 method for class 'cordist'
pairwise_dist(obj, X)
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. |
An object of class 'dist' containing the computed correlation distances.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.