Skip to contents

The labels generated represent numbers rescaled to compensate for a change in unit's by a factor of ten or by a power of ten.

Usage

SI_pl_format(exponent = 0, digits = 3, ...)

SI_plain(x, exponent = 0, digits = 3, ...)

Arguments

exponent

numeric Power of 10 to use as multiplier

digits

number of significant digits to show

...

other arguments passed on to format

x

a numeric vector to format

Value

a function with single parameter x, a numeric vector, that returns a character vector

Examples


SI_pl_format()(1:10)
#>  [1] "1"  "2"  "3"  "4"  "5"  "6"  "7"  "8"  "9"  "10"
SI_pl_format()(runif(10))
#>  [1] "0.0808" "0.8340" "0.6010" "0.1570" "0.0074" "0.4660" "0.4980" "0.2900"
#>  [9] "0.7330" "0.7730"
SI_pl_format(exponent = 2)(runif(10))
#>  [1] "0.008750" "0.001750" "0.000342" "0.003200" "0.004020" "0.001960"
#>  [7] "0.004040" "0.000637" "0.003890" "0.009760"
SI_plain(1:10)
#>  [1] "1"  "2"  "3"  "4"  "5"  "6"  "7"  "8"  "9"  "10"
SI_plain(runif(10))
#>  [1] "0.2900" "0.6780" "0.7350" "0.1960" "0.9810" "0.7420" "0.0514" "0.5300"
#>  [9] "0.6960" "0.6890"
SI_plain(runif(10), digits = 2)
#>  [1] "0.031" "0.230" "0.300" "0.640" "0.480" "0.430" "0.710" "0.950" "0.180"
#> [10] "0.220"