Skip to main content
edited title
Link
gringer
  • 15.1k
  • 5
  • 24
  • 83

easy Removing missing categories from geom_bar inquiry

edited tags
Link
user438383
  • 1.8k
  • 1
  • 9
  • 21
Source Link
rimo
  • 1.1k
  • 3
  • 18

easy geom_bar inquiry

I have a simple dataframe that includes points where the x values are 0, 1, 2, 3, 4, and 7. When I go to plot the data this is what ggplot2 gives me:

enter image description here

I only want to include the points mentioned above. How do I take out the instance of 5 and 6 in the bar plot?

(I have tried googling the answer and nothing is coming up with my actual need so I figured I'd ask the community which might give an answer sooner - please be kind I know this is bound to have a simple solution)