library(tidyverse)
## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.2 ──
## ✔ ggplot2 3.3.6      ✔ purrr   0.3.4 
## ✔ tibble  3.1.8      ✔ dplyr   1.0.10
## ✔ tidyr   1.2.1      ✔ stringr 1.4.1 
## ✔ readr   2.1.2      ✔ forcats 0.5.2 
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
library(dplyr)
library(ggplot2)
library(scales)
## 
## Attaching package: 'scales'
## 
## The following object is masked from 'package:purrr':
## 
##     discard
## 
## The following object is masked from 'package:readr':
## 
##     col_factor
survey <- read.csv("cleaned-ea-survey.csv")
view(survey)
mean(na.omit(survey$AdditionalMaterials) == TRUE)
## [1] 0.6160338
survey %>%
  group_by(College) %>%
  count(AdditionalMaterials)
## # A tibble: 14 × 3
## # Groups:   College [5]
##    College                                           AdditionalMaterials     n
##    <chr>                                             <lgl>               <int>
##  1 College of Agriculture and Environmental Sciences FALSE                  20
##  2 College of Agriculture and Environmental Sciences TRUE                   28
##  3 College of Agriculture and Environmental Sciences NA                     32
##  4 College of Biological Sciences                    FALSE                  15
##  5 College of Biological Sciences                    TRUE                   31
##  6 College of Biological Sciences                    NA                     25
##  7 College of Engineering                            FALSE                   9
##  8 College of Engineering                            TRUE                   17
##  9 College of Engineering                            NA                     19
## 10 College of Letters and Science                    FALSE                  47
## 11 College of Letters and Science                    TRUE                   68
## 12 College of Letters and Science                    NA                     70
## 13 <NA>                                              TRUE                    2
## 14 <NA>                                              NA                     40
temp <- survey %>%
  group_by(Improvements) %>%
  tally()
view(temp)
survey %>%
  group_by(College) %>%
  count(AdditionalMaterials)
## # A tibble: 14 × 3
## # Groups:   College [5]
##    College                                           AdditionalMaterials     n
##    <chr>                                             <lgl>               <int>
##  1 College of Agriculture and Environmental Sciences FALSE                  20
##  2 College of Agriculture and Environmental Sciences TRUE                   28
##  3 College of Agriculture and Environmental Sciences NA                     32
##  4 College of Biological Sciences                    FALSE                  15
##  5 College of Biological Sciences                    TRUE                   31
##  6 College of Biological Sciences                    NA                     25
##  7 College of Engineering                            FALSE                   9
##  8 College of Engineering                            TRUE                   17
##  9 College of Engineering                            NA                     19
## 10 College of Letters and Science                    FALSE                  47
## 11 College of Letters and Science                    TRUE                   68
## 12 College of Letters and Science                    NA                     70
## 13 <NA>                                              TRUE                    2
## 14 <NA>                                              NA                     40
freq <- c(28/(48), 31/46, 17/26, 68/(47+68))
college <- c("College of Agriculture and Environmental Sciences", "College of Biological Sciences", "College of Engineering", "College of Letters and Science")
materials <- data.frame(college, freq)


ggplot(materials, aes(x = college, y = freq)) +
  geom_bar(stat = "identity") + 
  ylim(0, 1)

selections <- c("Communication around how to opt out", "Communication around when to opt out", "Communication on how to access textbooks", "Equitable Access should include required material that is not currently covered", "Cost (i.e. cost of Equitable Access is too high)")
count <- c(158, 172, 140, 220, 267)

improvements <- data.frame(selections, count)

plot <- ggplot(improvements, aes(x = selections, y = count)) +
         geom_bar(stat = "identity")
plot + coord_flip()