R filling in missing data in Bar chart

I am trying to make a bar chart of the responses of a questionnaire. Said questionnaire is scored from 0-24 and has around 2,500 responses. I am trying to make a chart that demonstrates the amount of responses from different groups (this has been done via placing each variable next to eachother on the graph to compare using the beside=TRUE and having a legend included), it has worked well for the majority of the answers and is accurate, however, where there were no responses of 1, 3 and 6 on the questionairre, R has filled them in on the bar chart (when there should be nothing displayed). I am a bit confused as to why this has happened or how to account for the 'missing' data even though it just does not exist in the table due to not being chosen as a rating in the questionnaire answers.

The x axis would be the number of the questionnaire, and Y axis is the frequency of each of those answers in the population


Hi, welcome!

We don't really have enough info to help you out. Could you ask this with a minimal REPRoducible EXample (reprex)? A reprex makes it much easier for others to understand your issue and figure out how to help.

If you've never heard of a reprex before, you might want to start by reading this FAQ:

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.