library("psych350lab")
number_SPSS(c(1000, 25000, 100))
# Returns: "1000" "25000" "100"
# Use with ggplot2 axis labels
library(ggplot2)
ggplot(superman, aes(x = clark_height, y = lois_height)) +
geom_point() +
scale_x_continuous(labels = number_SPSS) +
theme_SPSS()Format Numbers SPSS-Style
Description
Formats numbers without thousands separators, matching SPSS axis label defaults. Useful for axis labels in combination with theme_SPSS().
Usage
number_SPSS(x, big.mark = "", ...)
Arguments
x
|
Numeric vector to format. |
big.mark
|
Character. Thousands separator. Default ““ (no separator).
|
…
|
Additional arguments passed to scales::number().
|
Value
A character vector of formatted numbers.