-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.Rmd
74 lines (64 loc) · 1.94 KB
/
main.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
---
title: "IPEDS Peer Report 2016-2017"
author:
- "Office of Decision Support"
- "University of Nevada, Las Vegas"
date: "`r Sys.Date()`"
output:
pdf_document:
toc: true
toc_depth: 2
header-includes:
- \usepackage{float}
- \usepackage{amsmath}
- \usepackage{amssymb}
- \usepackage{tcolorbox}
- \usepackage{fancyhdr}
- \usepackage{hyperref}
---
```{r setup, include = FALSE}
knitr::opts_chunk$set(echo = TRUE, fig.width = 8, fig.height = 8)
## Load packages
library(knitr)
library(RODBC)
library(ggplot2)
library(xtable)
library(reshape2)
library(Hmisc)
## Source files
source("queries.R")
## Aesthetics
cols <- c("#B10202", rep("#666666", length(id_vec)-1))
names(cols) <- as.character(report_list[[2]]$Institution)
```
```{r, echo = FALSE, warning = FALSE, message = FALSE, results = 'asis'}
for (i in 2:length(report_list)) {
cat("\\pagebreak")
cat(paste0("\\section{", my_report_metrics$Report_Name[i], "}\n"))
df <- report_list[[i]]
df$Institution <- as.character(df$Institution)
i_plot <- ggplot(df,
aes(Institution, Metric, fill = Institution)) +
geom_col() +
labs(title = "",
x = "",
y = my_report_metrics$Report_Name[i]) +
guides(fill = "none") +
theme_light() +
theme(axis.text.x = element_text(angle = 45, vjust = 1, hjust = 1)) +
scale_fill_manual(values = cols) +
scale_y_continuous(labels = scales::comma)
print(i_plot)
df$UNITID <- as.character(df$UNITID)
print(xtable(df,
caption = my_report_metrics$Report_Name[i],
label = paste0("table", i)),
table.placement = "H",
caption.placement = "top",
include.rownames = FALSE,
include.colnames = TRUE,
comment = FALSE,
format.args = list(big.mark = ",",
decimal.mark = "."))
}
```