Learn R Programming

parameters (version 0.2.0)

format_p: p-values formatting

Description

Format p-values.

Usage

format_p(p, stars = FALSE, stars_only = FALSE, name = "p",
  missing = "")

Arguments

p

value or vector of p-values.

stars

Add significance stars (e.g., p < .001***).

stars_only

Return only significance stars.

name

Name prefixing the text. Can be NULL.

missing

Value by which NA values are replaced. By default, an empty string (i.e. "") is returned for NA.

Value

A formatted string.

Examples

Run this code
# NOT RUN {
format_p(c(.02, .065, 0, .23))
format_p(c(.02, .065, 0, .23), name = NULL)
format_p(c(.02, .065, 0, .23), stars_only = TRUE)
# }

Run the code above in your browser using DataLab