jared's answer can be further improved:
scales::label_percent(accuracy = 1)
can be used to format both kind of labels in geom_text()
and scale_y_continuous()
consistently and without repeating code
geom_bar(stat = "identity")
can be abbreviated by geom_col()
# function to format percent labels
lp <- scales::label_percent(accuracy = 1)
library(ggplot2)
ggplot(data = GradeSTEM_data,
aes(x = Grade, y = percent, fill = STEMflag, label = lp(percent))) +
geom_col(position = "fill") +
scale_y_continuous(labels = lp) +
geom_text(position = position_stack(vjust = 0.5))

Data
GradeSTEM_data <- data.frame(
Grade = factor(rep(c("A", "B", "C", "P", "NP"), 2),
levels = c("A", "B", "C", "P", "NP")),
STEMflag = factor(x = c(rep("STEM", 5), rep("NONSTEM", 5)),
levels = c("STEM", "NONSTEM")),
percent = c(0.95, 0.93, 0.90, 0.67, 0.86,
0.05, 0.07, 0.10, 0.33, 0.14))