exact_pvalue: Calculate Exact P-Value for Correlation

View source: R/batch_cor.R

exact_pvalueR Documentation

Calculate Exact P-Value for Correlation

Description

Computes the exact p-value for the correlation between two numeric variables using a specified correlation method.

Usage

exact_pvalue(x, y, method)

Arguments

x

Numeric vector representing the first variable.

y

Numeric vector representing the second variable.

method

Character string specifying the correlation method: '"spearman"', '"pearson"', or '"kendall"'.

Value

Numeric value representing the exact p-value.

Author(s)

Dongqiang Zeng

Examples

# Simulate data
set.seed(123)
x <- rnorm(100)
y <- rnorm(100)
p_val <- exact_pvalue(x = x, y = y, method = "spearman")
print(p_val)

IOBR documentation built on May 30, 2026, 5:07 p.m.