I want y-axis labels that have a comma but no decimal points. When I use the 'labels=comma' option in ggplot I get the comma, it also adds in 2 decimals points. When I remove the option I get rid of the decimal points but also lose the comma.
ggplot(birth_decade_data, aes(x = age, y = disp_inc, group = birth_decade, col = birth_decade))+
geom_point(size=2)+
geom_line(size=1.05)+
scale_y_continuous(expand=c(0,0), limits = c(0,80000), breaks=c(20000,40000,60000,80000), labels=comma)+
scale_x_continuous(expand = c(0.01, 0.01), breaks = c(seq(15,65,5)), limits = c(24,65))
Thanks in advance for your help, I've spent ages searching for a solution to this.
Sorry, data looks like this:
> birth_decade_data
year birth_decade disp_inc age
1989 1940s 35161 44.1
1989 1940s 35161 44.1
1989 1950s 31285 34.5
1989 1960s 37403 25.0
1989 1970s 33117 17.7
1989 1980s 26700 7.00
1999 1940s 39448 54.2
1999 1950s 38645 44.3
1999 1960s 38617 34.6
1999 1970s 41514 24.4
1999 1980s 33972 16.7
... more rows