panelCorPearson: Display Correlation Values in Pairs Plot

View source: R/Seurat.Utils.Visualization.R

panelCorPearsonR Documentation

Display Correlation Values in Pairs Plot

Description

This function displays the correlation coefficient and significance level within a scatterplot generated by the pairs() function. The default correlation method is Pearson, but Kendall or Spearman methods can also be selected.

Usage

panelCorPearson(x, y, digits = 2, prefix = "", cex.cor = 2, method = "pearson")

Arguments

x

Numeric vector or the first half of the data pair.

y

Numeric vector or the second half of the data pair.

digits

Number of significant digits to display in the correlation coefficient. Default: 2.

prefix

A string prefix added before the correlation coefficient. Default: "".

cex.cor

The character expansion factor for the correlation coefficient text. This argument directly influences the text size. Default: 2.

method

The method of correlation coefficient calculation. It can be "pearson" (default), "kendall", or "spearman".

Value

This function does not return a value but modifies the current plot by adding the correlation coefficient and its significance level.

Examples

## Not run: 
pairs(mtcars[, 1:4], panel = panelCorPearson)

## End(Not run)

vertesy/Seurat.utils documentation built on Dec. 4, 2024, 5:20 p.m.