I'm creating a bar chart using ggplot2 in R and I want to remove the missing values in my x-values, I have tried a few different ways of getting ride of "NA"s but nothing seems to change the output. Currently my code reads (data is not publicly available so I have changed variable names):
ggplot(data = mydata, aes(x= x_mydata, y= y_mydata, na.rm = TRUE)) +
stat_summary(fun.y = "mean", geom="bar", na.rm = TRUE)