This project visualizes the data from the college report card, https://collegescorecard.ed.gov/data/, using R.
You can simply run scorecard_county_map.Rmd in RStudio using the Knit HTML button at the top of the screen.
To create the HTML file from the primary script file, open an R session in the ./scripts directory and use
rmarkdown::render('scorecard_county_map.Rmd')Aside from the files hosted in the repository, a few other larger data sources must be in the ./data/ folder:
MERGED2011_PP.csvfrom the College Scorecard Datagz_2010_us_050_00_500k.*cartographic boundary files from the U.S. Census Bureau. Download the 500k file from the page (or directly from this link) and unzip all files in the./datadirectory
The following R packages and their dependencies are required:
libs <- c('dplyr', # make data wrangling easier
'gstat', # kriging
'geojsonio', # to handle geojson data type
'htmlwidgets', # way to bind javascript libraries
'knitr', # combine R code and markdown
'leaflet', # interactive mapping module
'maptools', # mapping projections
'RColorBrewer', # create color palettes
'readr', # faster reading of large csv files
'rgdal', # interact with gdal GIS framework
'rgeos', # interact with geos GIS framework
'tidyr') # make data wrangling easierrmarkdown is also required to produce the final HTML file if you choose not to use RStudio.
Note that the geospatial packages (e.g., rgdal and rgeos) may require the installation of geospatial libraries on your local machine. For OS X, many can be installed using prepackaged binaries found here.