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, ...)
A numeric vector to be formatted.
Number of significant digits of the largest absolute value.
Further arguments passed to format()
, e.g., big.mark = "'"
.
A character vector of formatted numbers.