Formats p-values specifically for display in plots (e.g., survival curves). Returns formatted string with "p = " or "p < " prefix.

lpvalue2(x, digits)

Arguments

x

Numeric p-value

digits

Number of decimal places to display (default from context)

Value

Character string with "p = " or "p < " prefix

Details

Formatting rules:

  • p < 10^-digits: returns "p < threshold" (e.g., "p < 0.001")

  • p >= threshold: returns "p = value" rounded to specified digits

Used by: ggkmcif2() for survival curve annotations in main.R and ggkmcif3.R

Examples

if (FALSE) { # \dontrun{
lpvalue2(0.0001, 3)  # Returns: "p < 0.001"
lpvalue2(0.0456, 3)  # Returns: "p = 0.046"
} # }