batch_cor: Batch Correlation Analysis

View source: R/batch_cor.R

batch_corR Documentation

Batch Correlation Analysis

Description

Performs a batch correlation analysis between a target variable and multiple feature variables in a dataset. This function allows for the selection of the correlation method and applies corrections for multiple testing.

Usage

batch_cor(data, target, feature, method = "spearman")

Arguments

data

A data frame containing the dataset with both target and feature variables.

target

A character string specifying the name of the target variable within the dataset.

feature

A character vector specifying the names of the feature variables to be analyzed.

method

A character string specifying the correlation method to be used; default is "spearman".

Value

Returns a tibble containing the feature names, p-values, correlation coefficients, adjusted p-values, log-transformed p-values, and significance stars based on p-value thresholds.

Author(s)

Dongqiang Zeng

Examples

# Load TCGA-STAD microenvironment signature data
data("sig_stad", package = "IOBR")
# Conduct correlation analysis
results <- batch_cor(data = sig_stad, target = "CD_8_T_effector", feature = colnames(sig_stad)[69:ncol(sig_stad)])

IOBR/IOBR documentation built on Sept. 9, 2024, 8:36 p.m.