I'm trying to make a simple bargraph in ggplot to show the number of police officer deaths attributed to various causes each year. The widths of the columns is not consistent. For example, deaths due to Covid were only in 2020, and the pink bar showing that is as wide as all the bars for each year in other categories. How can I made the bars all be the same width even when there is only one year that has data in a given cause of death?
Data table "cause"
ggplot(data = cause, aes(x=causeMonthState, y=deaths, fill = as.factor(year)))+
geom_bar(stat="identity", position = "dodge", width = .5)+
theme(axis.text.x = element_text(angle = 90))