num2str.tibble: Format entries in a tibble using num2str

Description Usage Arguments Examples

View source: R/core.R

Description

Parameters for num2str can be specified as vectors indicating the columns to which values apply, with NA interpreted as using the default value

Usage

1
2
3
4
5
6
7
8
9
num2str.tibble(
  tbl,
  precision = 2,
  isProportion = F,
  truncateZeros = F,
  prefix = "",
  minPrefix = NA,
  ...
)

Arguments

tbl

tibble to execute num2str

precision

decimal places to preserve

isProportion

whether to strip leading 0 for 0.x values

truncateZeros

whether to strip trailing 0s

prefix

prefix for the number string (e.g. " = ")

minPrefix

for transforming numbers like .000 into < .001

...

Arguments passed on to num2str

num

number to convert to string

Examples

1
2
3
4
5
6
7
library(tibble)
x <- tibble(chr = "character", int = 1:10, prop = runif(10), tProp = runif(10))
num2str.tibble(
  x,
  isProportion = c(NA, NA, TRUE, TRUE),
  truncateZeros = c(FALSE, FALSE, FALSE, TRUE)
)

mjaquiery/prettyMD documentation built on Oct. 6, 2021, 4:16 p.m.