signs.Rd
The true minus sign (UTF 2212) -- neither an em dash, nor an en dash,
nor the usual hyphen-minus -- is highly underrated.
It just makes everything look better!
This function builds on the formatting functions
from the scales
package by replacing the hyphen-minus
with a true minus, and adding a plus sign if desired.
signs(..., format = scales::number, plus_sign = FALSE)
... | Numeric vector and any other arguments passed to format. |
---|---|
format | Function that formats a numeric vector,
such as |
plus_sign | Logical. Should positive values start with plus signs? |
A UTF-8
character vector
#> [1] "-5" "-4" "-3" "-2" "-1" "0" "1" "2" "3" "4" "5"#> [1] "-5" "-4" "-3" "-2" "-1" "0" "+1" "+2" "+3" "+4" "+5"#> [1] "-5.0%" "-4.0%" "-3.0%" "-2.0%" "-1.0%" "+0.0%" "+1.0%" "+2.0%" "+3.0%" #> [10] "+4.0%" "+5.0%"