In the previous version of scales there was a function comma() that could be used to format a number using commas as separators. However, in 1.1.0 comma() is deprecated and it seems like the suggested replacements are things like label_comma(). I don't see vignettes for scales, and the example code in the function documentation is pretty opaque to me, but it seems like label_comma() is just for use within a ggplot2scale_ function. What should I use to generically format a variable with commas?
library(scales)
library(dplyr)
df <- tibble(prem = c(1000.51, 1000.4, 10, 17))
df <- df %>%
mutate(prem_formatted = label_comma(prem))
#> Error: Column `prem_formatted` is of unsupported type function
This sounds like it would be a good documentation request for the scales package. Would you mind filing an issue there?
Or, if you prefer, I'm happy to bring this over there for you.
I feel like the past two release announcements for scales could be reshaped into vignettes, and we could definitely do a better job of linking the relevant info from the ggplot2 docs.