smart_signif | R Documentation |
Minimum preferred significant digits
smart_signif(x, digits = 3L, ...)
x |
numeric, length 2 or more |
digits |
integer, number of preferred remaining significant digits |
... |
unused, kept for compatibility reasons |
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.
numeric vector
Original question on StackOverflow
set.seed(1)
x <- cumsum(abs(rnorm(10,100,100)))
smart_signif(x, 1)
smart_signif(x, 2)
smart_signif(x, 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.