Right now I can get labels of the fill value above by bars in ggplot geom_bar. But what I can't seem to do is change the number of decimal places of the label. Right now it has 9 decimal places and I only want 2. I have tried using round() and digits= unsuccessfully. I am not sure where to place them in my code I think.
Proportion is what I want labeled with only 2 decimal places
Thank you!
PaperMazeProportion <- ggplot(PM_df, aes(factor(OrientationNum), Proportion, fill=Choice)) +
stat_summary(fun.y = mean, geom = "bar", position = "dodge") +
labs(x= "Orientation of Maze",
title = "Paper Maze Path Choice Penn State; May 07, 2018") +
theme(plot.title = element_text(hjust = 0.5)) +
scale_y_continuous(limits= c(0, 0.65)) +
scale_x_discrete(labels=c("North-South", "South-North", "East-West", "West-East"), breaks=c("1", "2", "3", "4")) +
geom_text(aes(label=Proportion), position=position_dodge(width=0.9), digits=1, vjust=-0.25, size=3)