Learn R Programming

nda (version 0.3.0)

dCor: Distance-Correlation Matrix

Description

Calculates distance correlation for two vectors or for every unique pair of matrix columns.

Usage

dCor(x, y = NULL, test = FALSE, adjust = "BH", alpha = NULL,
     parallel = FALSE, cores = 1L, R = 499L)

Value

A coefficient or symmetric matrix when test = FALSE; otherwise a list with r and p.

Arguments

x

Numeric vector, matrix, or data frame.

y

Optional numeric vector paired with x.

test

Run permutation tests and return adjusted p-values.

adjust

Method passed to p.adjust.

alpha

Optional adjusted-p threshold used to zero nonsignificant coefficients.

parallel

Calculate unique matrix pairs in parallel on supported systems.

cores

Requested core count.

R

Permutation count passed to energy::dcor.test.

Examples

Run this code
x <- matrix(rnorm(80), 20, 4)
dCor(x)
if (FALSE) dCor(x, test = TRUE, R = 999)

Run the code above in your browser using DataLab