I am trying to produce something akin to a histogram of incomes with ggplot2
. However, because I am not trying to show the frequency in the y-axis but a calculated variable from my data.frame, I figured I had to use geom_bar()
and assign buckets as a new factor variable in my data.frame
. Now I would like to show all bars I have determined a bucket for, but not show all labels on the x-axis. I figured there must be some way to do this with the breaks =
in scale_x_discrete()
, but couldn't figure out how to get this to just take "show me every second label" or something like that.
Would anyone have a suggestion for how to just show every second label on the x-axis for a discrete x-axis based upon a factor variable?
(Thank you very much for anyone's help and sorry, if I'm throwing around the wrong terms here. I'm new to R and just trying to describe everything as accurately as I can.)