I am trying to create a plot in ggplot with year on the x-axis, however, when I plot the data there is a gap between 2018 and 2020 data (I do not have data for 2019). I am looking for help on how to remove this gap. Thank you!
Here is my script:
p1<-ggplot(df1, aes(x=year, y=mean, fill=strata))+
geom_bar(aes(y = mean), , position="dodge", stat="identity") +
scale_x_continuous(labels=df1$year, breaks = df1$year)+
geom_errorbar(aes(ymin=mean-se,
ymax=mean+se), width=0.2,position=position_dodge(0.9 ))