library(ggplot2)
df <- ggplot2::txhousing %>% removenarows(all = FALSE)
ggplot(df, aes(x = sales, y = volume)) +
geom_point() +
scale_x_dollar() +
scale_y_abbr()
# Use any argument from scale_x/y_continuous
ggplot(df, aes(x = listings, y = log(inventory))) +
geom_point() +
scale_x_comma() +
scale_y_percent(limits = c(0, 3))
# Use any argument from scale_x/y_continuous AND formatNum
ggplot(df, aes(x = median, y = inventory)) +
geom_point() +
scale_x_formatNum(n.breaks = 3, pre = "@", abbr = TRUE) +
scale_y_formatNum(position = "right", decimals = 0, pos = " X")
Run the code above in your browser using DataLab