-
Notifications
You must be signed in to change notification settings - Fork 7
/
README.Rmd
94 lines (71 loc) · 2.64 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
---
title: rscorecard
output: md_document
---
# rscorecard <img src="man/figures/logo.png" align="right" />
```{r, include = FALSE}
options(width = 100)
```
[![R build
status](https://github.com/btskinner/rscorecard/workflows/R-CMD-check/badge.svg)](https://github.com/btskinner/rscorecard/actions)
[![GitHub
release](https://img.shields.io/github/release/btskinner/rscorecard.svg)](https://github.com/btskinner/rscorecard)
[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/rscorecard)](http://cran.r-project.org/package=rscorecard)
This package is an R wrapper for the [U.S. Department of Education
College Scorecard](https://collegescorecard.ed.gov) API. It allows
users to select and filter Scorecard variables with piped commands a
la [`dplyr`](http://github.com/hadley/dplyr).
## Installation
Install the latest released version from CRAN with
```r
install.packages("rscorecard")
```
Install the latest development version from Github with
```r
devtools::install_github("btskinner/rscorecard")
```
This package relies on the Scorecard data dictionary, so I will
attempt to update it in a timely fashion whenever new Scorecard data
are released. Because it sometimes takes a few days to get a package
on CRAN, you may want to download the developmental version in the
days immediately following a data update.
## Usage
### Set API key
Get your Data.gov API key at
[https://api.data.gov/signup/](https://api.data.gov/signup/). Save
your key in your R environment at the start of your R session using
`sc_key()`:
```r
## use your real key in place of the Xs
sc_key('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')
```
### Request data
```{r}
library(rscorecard)
df <- sc_init() |>
sc_filter(region == 2, ccbasic == c(21,22,23), locale == 41:43) |>
sc_select(unitid, instnm, stabbr) |>
sc_year("latest") |>
sc_get()
df
```
For more example calls and information about other package commands,
see the [extended
vignette](https://www.btskinner.io/rscorecard/articles/introduction.html).
### Data dictionary
To look up information about data elements, use the `sc_dict()`
function.
```{r}
sc_dict("control")
```
## Further references
* [College Scorecard Website](https://collegescorecard.ed.gov)
* [Data
documentation](https://collegescorecard.ed.gov/assets/FullDataDocumentation.pdf)
* [Data dictionary
[XLS]](https://collegescorecard.ed.gov/assets/CollegeScorecardDataDictionary.xlsx)
* Reports
* [Policy
paper](https://collegescorecard.ed.gov/assets/BetterInformationForBetterCollegeChoiceAndInstitutionalPerformance.pdf)
* [Technical
paper](https://collegescorecard.ed.gov/assets/UsingFederalDataToMeasureAndImprovePerformance.pdf)