format_p_values_at: Format numeric columns for display

Description Usage Arguments Value See Also Examples

Description

Combines mutate_at() and as_formatted_p_value()

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
format_p_values_at(
  .tbl,
  .vars,
  decimal_places = 3,
  prefix = "p",
  less_than_cutoff = 0.001,
  remove_trailing_zeroes = T,
  alpha = 0.05,
  ns_replacement = NULL
)

Arguments

.tbl

A data frame

.vars

A vars() list of symbolic columns

decimal_places

Decimal places to display

prefix

Prefix to prepend (default "p=")

less_than_cutoff

Cut-off for small p values. Values smaller than this will be displayed like "p<..."

remove_trailing_zeroes

If the required decimal places are less than decimal places, should resulting trailing zeros be removed?

alpha

Cut-off for assuming significance, usually 0.05

ns_replacement

If p value is not significant (is > alpha), it will be replace by this string (e.g. "n.s.") If NULL (default), no replacement is performed.

Vectorised (in parallel) over x, prefix, less_than_cutoff, alpha and ns_replacement.

Value

Value of mutate_at

See Also

format_numbers_at

Examples

1
2
3
4
5
library(tibble)
library(magrittr)
library(dplyr)
tibble(p=c(0.05, 0.0001)) %>%
    format_numbers_at(vars(p))

tidytidbits documentation built on March 8, 2021, 5:07 p.m.