Created
May 1, 2016 19:51
-
-
Save rshyam1/f46ca1ef641f65deacbd422ae39bf10b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Changing Education numerical values to facotrs | |
edu_vec=c(1,2,3,4) | |
edu_desc=c("graduate school","university","high school","others") | |
credi_tbl_temp$EDUCATION=factor(x=credit_tbl$EDUCATION,levels=edu_vec,labels=edu_desc) | |
#Creating Bar Plots for Education as factors for fill and default as factor on x-axis | |
e2=ggplot(data = credi_tbl_temp, aes(x = default.payment.next.month)) + | |
geom_bar(aes (fill = EDUCATION), position = "dodge") + | |
ggtitle("Education Profile of Default Payment Vs Non-Default")+ | |
xlab("")+ylab("Number of Individuals") | |
e2 | |
# Education bar with fill | |
e3=ggplot(data = credi_tbl_temp, aes(x = default.payment.next.month)) + | |
geom_bar(aes (fill = EDUCATION), position = "fill") + | |
ggtitle("Education Profile of Default Payment Vs Non-Default")+ | |
xlab("")+ylab("") | |
e3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment