Learn R Programming

myTAI (version 2.3.4)

exp_p: Format P-Value for Scientific Notation

Description

Format p-values in scientific notation for plot annotations.

Usage

exp_p(p, sci_thresh = 4)

Value

Expression object for use in plot annotations

Arguments

p

Numeric p-value

sci_thresh

Numeric threshold for using scientific notation (number of decimal places)

Details

This function formats p-values in scientific notation using the format "p = a × 10^b" which is suitable for ggplot2 annotations and maintains proper mathematical formatting.

Examples

Run this code
# Format p-value for plotting
expr <- exp_p(0.001)

Run the code above in your browser using DataLab