Skip to content

Instantly share code, notes, and snippets.

@sjstebbins
Created July 25, 2016 16:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sjstebbins/05737a304f83912f0bb3ec15acb99845 to your computer and use it in GitHub Desktop.
Save sjstebbins/05737a304f83912f0bb3ec15acb99845 to your computer and use it in GitHub Desktop.
college costs plot
#select data from main data frame
increasing_college_costs <- select(data,Date,Total.cost.of.attendance..on.campus.)
#melt to single column
increasing_college_costs <- melt(increasing_college_costs,id = 'Date', value.name='Amount.in.Thousands')
#plot
ggplot(increasing_college_costs, aes(x=Date,y=Amount.in.Thousands,group=variable,color=variable)) + geom_line() + ggtitle('Average College Costs') + theme_fivethirtyeight() + theme(legend.title=element_blank()) + theme(axis.title = element_text(), axis.title.x = element_blank()) + ylab('Dollars')+theme(legend.position="none")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment