pvalr-deprecated: A function for formatting p-values

pvalr-deprecatedR Documentation

A function for formatting p-values

Description

Similar to the base R function format.pval() but does things the way that I want them. Inspiration and lots of help with this one owed to https://github.com/raredd/rawr.

Usage

pvalr(pvals, sig_limit, d, html)

Arguments

pvals

A numeric value or vector of p-values

sig_limit

Lower bound for precisions

d

Integer indicating the number of decimal places (round)

html

Logical; if TRUE, uses &lt; instead of <.

Value

A character value or vector of formatted p-values

See Also

lamisc-deprecated

Examples

library(dplyr)

pvals <- c(.133213, .06023, .004233, .000000134234, 1.0)
pvals_2 <- c(.133213, .06023, .004233, .000000134234, NA)
pvalr(pvals)
pvalr(pvals_2)

df <- tibble::tibble(p = pvals,
                     p_2 = pvals_2)

df %>%
  mutate(p_formatted = pvalr(p),
         p_2_formatted = pvalr(p_2)
  )


emilelatour/lamisc documentation built on April 9, 2024, 10:33 a.m.