View source: R/sv_importance.R
format_max | R Documentation |
Formats a numeric vector in a way that its largest absolute value determines the number of digits after the decimal separator. This function is helpful in perfectly aligning numbers on plots. Does not use scientific formatting.
format_max(x, digits = 4L, ...)
x |
A numeric vector to be formatted. |
digits |
Number of significant digits of the largest absolute value. |
... |
Further arguments passed to |
A character vector of formatted numbers.
x <- c(100, 1, 0.1)
format_max(x)
y <- c(100, 1.01)
format_max(y)
format_max(y, digits = 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.