smart_signif: Minimum preferred significant digits

Description Usage Arguments Details Value author See Also Examples

View source: R/smart_signif.R

Description

Minimum preferred significant digits

Usage

1
smart_signif(x, digits = 3L, ...)

Arguments

x

numeric, length 2 or more

digits

integer, number of preferred remaining significant digits

...

unused, kept for compatibility reasons

Details

Facilitate reducing numbers to their least distinguishable significant digits, where "distinguishable" means "between neighbors". This means that if reducing more digits would cause two neighbors to reduce to the same number, then the reduction cannot take place.

Value

numeric vector

author

r2evans

See Also

Original question on StackOverflow

Examples

1
2
3
4
5
set.seed(1)
x  <- cumsum(abs(rnorm(10,100,100)))
smart_signif(x, 1)
smart_signif(x, 2)
smart_signif(x, 3)

moodymudskipper/cutr documentation built on Aug. 23, 2019, 7:15 p.m.