Code for the stacked bar plot could look something like this:
library(ggplot2)
brks <- c(0, 0.25, 0.5, 0.75, 1)
ggplot(data=probs,aes(x=ProsperScore,y=Freq,fill=LoanStatus)) +
geom_bar(stat="identity") +
scale_y_continuous(breaks = brks, labels = scales::percent(brks)) +
scale_x_discrete(breaks = c(3,6,9))
More complete code, demonstrating how you would go about adding percentages to the plot, is here:
library(ggplot2)
library(plyr)
brks <- c(0, 0.25, 0.5, 0.75, 1)
probs <- probs %>% dplyr::group_by(ProsperScore) %>%
dplyr::mutate(pos=cumsum(Freq)-(Freq*0.5)) %>%
dplyr::mutate(pos=ifelse(Freq==0,NA,pos))
probs$LoanStatus <- factor(probs$LoanStatus, levels = rev(levels(probs$LoanStatus)))
ggplot(data=probs,aes(x=ProsperScore,y=Freq,fill=LoanStatus)) +
geom_bar(stat="identity") +
scale_y_continuous(breaks = brks, labels = scales::percent(brks)) +
scale_x_discrete(breaks = c(3,6,9)) +
geom_text(data=probs, aes(x = ProsperScore, y = pos,
label = paste0(round(100*Freq),"%")), size=2)

To only show the percentages in the first column of the graph, add %>%
dplyr::mutate(pos=ifelse(ProsperScore==1,pos,NA))
to the dplyr
calls.