I am trying to put label in my plot I am getting error:
ggplot(aes(x = factor(Pclass), fill = factor(Survived)), data = train) +
geom_bar(color = "black", width = 0.30) +
xlab("People Class") +
ylab("Count")+
geom_text(aes(label = factor(Survived)))
Error: geom_text requires the following missing aesthetics: y
How can I add label without using y aesthetics or please correct if I am doing wrong. I am using Titanic train.csv data set Titanic: Machine Learning from Disaster