prop2str: Wrapper for 'num2str(..., isProportion = T)'

Description Usage Arguments Examples

View source: R/core.R

Description

Wrapper for num2str(..., isProportion = T)

Usage

1
prop2str(x, precision = 3, ...)

Arguments

x

number to stringify

precision

number of decimal places to preserve

...

Arguments passed on to num2str

num

number to convert to string

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

Examples

1
2
3
4
data.frame(input = c(seq(-10,10),100),
  num = num2str(exp(c(seq(-10,10),100)), 4),
  prop = prop2str(exp(c(seq(-10,10),100)), 4)
)

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