### Example Report Assets Section
```{r setup, include=FALSE}
knitr::opts_chunk$set( echo = TRUE, message=F, warning=F )
```
```
# Be sure to hide all of the extra messages and code in the final report:
# ```{r setup, include=FALSE}
# knitr::opts_chunk$set( echo = F, message=F, warning=F )
# ```
```
```{r libraries}
# LOAD PACKAGES
library( dplyr )
library( pander )
library( knitr )
library( gender )
# SOURCE CUSTOM FUNCTIONS
source( "utils.R" )
```
```{r data}
# LOAD DATA
URL <- params$url
d <- read.csv( URL )
# FOR MANUAL TESTING ONLY
# URL <- "https://raw.githubusercontent.com/Watts-College/paf-514-template/main/labs/batch-demo/asu-salaries-2020.csv"
# d <- read.csv( URL )
# DATA STEPS
d$first.name <- get_first_name( d$Full.Name )
d <- add_gender( d )
d <- add_titles( d )
d <- fix_salary( d )
d <- # report sample
d %>%
filter( title != "" & ! is.na(title) ) %>%
filter( Department.Description %in% academic.units )
```
# Salary Range by Rank and Gender
```{r, results="asis", fig.height=7, fig.width=10}
# {r, results="asis", fig.height=7, fig.width=10}
t.salary <-
d %>%
group_by( title, gender ) %>%
summarize( q25=quantile(salary,0.25),
q50=quantile(salary,0.50),
q75=quantile(salary,0.75),
n=n() ) %>%
ungroup() %>%
mutate( p= round( n/sum(n), 2) )
t.salary %>% build_graph( unit="ALL ASU")
t.salary$q25 <- dollarize( t.salary$q25 )
t.salary$q50 <- dollarize( t.salary$q50 )
t.salary$q75 <- dollarize( t.salary$q75 )
t.salary %>% knitr::kable(format="html")
```