format_p: Format p-value

View source: R/format_p.R

format_pR Documentation

Format p-value

Description

Round and format p-values

Usage

format_p(x, digits = 1)

Arguments

x

numeric vector of p-values

digits

number of digits large p-values will be rounded to. Default is 2, and must be one of 1, 2, or 3.

Value

a string

Examples

p_vec <- c(0.00001, 0.01111, 0.0500000, 0.15, 0.99999)
format_p(p_vec)
format_p(p_vec, 2)
format_p(p_vec, 3)

ggsurvfit documentation built on May 29, 2024, 11:27 a.m.