Skip to contents

Format p-values in scientific notation for plot annotations.

Usage

exp_p(p)

Arguments

p

Numeric p-value

Value

Expression object for use in plot annotations

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

# Format p-value for plotting
expr <- exp_p(0.001)
# Use in ggplot annotation:
# annotate("text", x = 1, y = 1, label = expr, parse = TRUE)