/
setup_for_completions.Rmd
78 lines (59 loc) · 2.85 KB
/
setup_for_completions.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
---
title: "Set up your data for IPEDS Completions processing"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Set up your data for IPEDS Completions processing}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```
```{r setup, eval=FALSE, echo=FALSE}
library(IPEDSuploadables)
```
## To use the `produce_com_report` function, your student completions data must be in the format described below
>
* One row per person per degree level per cip per major
* One IPEDS Unitid per file
* Columns with values and types as described below (additional columns are allowed)
Note: Column names can use any capitalization method you like
```{r create_data_file_in_package, eval=FALSE, echo=FALSE}
#this chunk is only used during interactive session by the package maintainers, if the requirements have been updated
tryCatch(specs_COM <- googlesheets4::read_sheet("https://docs.google.com/spreadsheets/d/132EKp46TpEHPlVrG9FZxINxmVVz8UO0Ov989sP4lNaP/edit", sheet = 1),
error = function(x) message("Google Sheet unavailable"),
warning = function(y) message("There was a warning"))
usethis::use_data(specs_COM, overwrite = TRUE)
```
```{r specstable_df, echo=FALSE, warning=FALSE, message=FALSE}
#figure out why striped isn't working when format = 'html'
load("../data/specs_COM.rda")
library(magrittr)
specs_COM$ACCEPTABLE_VALUES <- stringr::str_replace_all(specs_COM$ACCEPTABLE_VALUES, pattern = "\\n", replacement = "<br>")
specs_COM_startingdf <- specs_COM[specs_COM$DATA_FRAME == 'startingdf', 2:4]
knitr::kable(specs_COM_startingdf,
format = 'html',
escape = FALSE,
col.names = c('Column Name', 'Column Type', 'Acceptable Value - Definition')) %>%
kableExtra::kable_styling(bootstrap_options = "striped") %>%
kableExtra::column_spec(2, italic = TRUE, width = '8em')
```
### If there are any cip code/degree level/major number combinations that are possible for students to obtain but are NOT represented in this year's student completions data, use the format below to incorporate them into the `make_com` functions.
>
* One row per degree level per cip per major
* One IPEDS Unitid per file
* Columns with values and types as described below (additional columns are allowed)
```{r specstable_com, echo=FALSE, warning=FALSE, message=FALSE}
#figure out why striped isn't working when format = 'html'
specs_COM_extracips <- specs_COM[specs_COM$DATA_FRAME == 'extracips', 2:4]
knitr::kable(specs_COM_extracips,
format = 'html',
escape = FALSE,
col.names = c('Column Name', 'Column Type', 'Acceptable Value - Definition'),
row.names = FALSE) %>%
kableExtra::kable_styling(bootstrap_options = "striped") %>%
kableExtra::column_spec(2, italic = TRUE, width = '8em')
```