R: Formatter for tagged labels using SI multipliers

SI_tg_format {ggspectra} | R Documentation

## Formatter for tagged labels using SI multipliers

### Description

The labels generated represent the same numbers, but with trailing zeros removed/added and compensated by attaching to each label an SI multiplier "prefix".

### Usage

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

    SI_tagged(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

### Note

If the exponent passed has no SI prefix defined, the exponent will be adjusted to match one.

### Examples

    SI_tg_format()(1:10)
    SI_tg_format()(runif(10))
    SI_tg_format(exponent = 2)(runif(10))
    SI_tagged(1:10)
    SI_tagged(runif(10))
    SI_tagged(runif(10), digits = 2)

[Package ggspectra version 0.2.3 Index]