Last active
July 25, 2016 16:23
-
-
Save sjstebbins/f1461de9d02e344beb705832daf645d1 to your computer and use it in GitHub Desktop.
Outstanding Student Loan Debt
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
#load data | |
student_loans_outstanding_df <- read.csv("https://fred.stlouisfed.org/data/SLOAS.csv") | |
#change column name | |
student_loans_outstanding_df <- transmute(student_loans_outstanding_df, Date=DATE, student_loans_outstanding=VALUE) | |
#convert to dollars | |
student_loans_outstanding_df$student_loans_outstanding = student_loans_outstanding_df$student_loans_outstanding * 100000 | |
#convert to Date | |
student_loans_outstanding_df$Date = as.Date(student_loans_outstanding_df$Date) | |
#plot | |
ggplot(student_loans_outstanding_df, aes(x=Date,y=student_loans_outstanding)) +geom_line( color='red') + ggtitle("Outstanding Student Loan Debt") + scale_x_date( labels = date_format("%Y")) + scale_y_continuous( labels = comma) + theme_fivethirtyeight() + theme(legend.title=element_blank()) + theme(axis.title = element_text(), axis.title.x = element_blank()) + ylab('Dollars') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment