format_pval2: Format P-values for tables

View source: R/format_pval2.R

format_pval2R Documentation

Format P-values for tables

Description

Easy wrapper around format.pval to make readability of p-values better. It converts only p-values below 0.00

Usage

format_pval2(p, threshold = 0.001, scientific = TRUE)

Arguments

p

A numeric vector of p-values to convert

threshold

A numeric threshold under which to convert p-values with scientific notation

scientific

A logical, whether to use scientific notation. (default = 'TRUE'). NOTE: 'scientific = FALSE' is basically meaningless

Value

A character vector with transformed p-values

Examples


pvalues <- c(runif(5, 0, 0.001), runif(5, 0, 0.3), runif(5, 0, 1))

format.pval2(pvalues)

format.pval2(pvalues, threshold = 0.05)

format.pval2(pvalues, threshold = 0.05, scientific = FALSE)


g-antonello/gautils documentation built on May 3, 2024, 10:51 a.m.