Thread for Gov 1005/1006 Students to Submit a Practice Reprex

clean_names() %>%
  group_by("Course Department")
#> Error in clean_names() %>% group_by("Course Department"): could not find function "%>%"
x
#> Error in eval(expr, envir, enclos): object 'x' not found
xlsx
#> Error in eval(expr, envir, enclos): object 'xlsx' not found

Created on 2020-02-18 by the reprex package (v0.3.0)

file:///C:/Users/Hamid%20Ali%20Khan/AppData/Local/Temp/RtmpGOclRF/reprex3210d3b3c/reprex_reprex.html

departments <- x %>% group_by(course_department) %>% mutate(summarize(num_enrolled = count(total)))
#> Error in x %>% group_by(course_department) %>% mutate(summarize(num_enrolled = count(total))): could not find function "%>%"
library(tidyverse)
library(readxl)
library(janitor)
#> 
#> Attaching package: 'janitor'
#> The following objects are masked from 'package:stats':
#> 
#>     fisher.test, chisq.test
library(reprex)

enrollment <- read_excel("class_enrollment_summary_by_term2.18.20.xlsx", skip = 3, na = c("")) %>%
  clean_names()
#> Error: `path` does not exist: 'class_enrollment_summary_by_term2.18.20.xlsx'

top_5 <- enrollment %>%
  group_by(course_department) %>%
  summarize(Enrolled = sum(total)) %>%
  arrange(desc(Enrolled))
#> Error in eval(lhs, parent, parent): object 'enrollment' not found
  slice(1:5)
#> Error in UseMethod("slice_"): no applicable method for 'slice_' applied to an object of class "c('integer', 'numeric')"
top_5
#> Error in eval(expr, envir, enclos): object 'top_5' not found`Preformatted text`
x <- read_excel("class_enrollment_summary_by_term218.20.xlsx", skip=3) %>%
  clean_names() %>%
  group_by(course_department) %>%
  summarize(totals = sum(total)) %>%
  arrange(desc(totals)) %>%
  slice(1:5) 
#> Error in read_excel("class_enrollment_summary_by_term218.20.xlsx", skip = 3) %>% : could not find function "%>%"

Created on 2020-02-18 by the reprex package (v0.3.0)

class_enrollment_summary_by_term2.18.20.xlsx
#> Error in eval(expr, envir, enclos): object 'class_enrollment_summary_by_term2.18.20.xlsx' not found
read_excel(file = "class_enrollment_summary_by_term2.18.20.xlsx")
#> Error in read_excel(file = "class_enrollment_summary_by_term2.18.20.xlsx"): could not find function "read_excel"

Created on 2020-02-18 by the reprex package (v0.3.0)

x <- read_excel(file = "class_enrollment_summary_by_term2.18.20.xlsx")
#> Error in read_excel(file = "class_enrollment_summary_by_term2.18.20.xlsx"): could not find function "read_excel"

Created on 2020-02-18 by the reprex package (v0.3.0)

enrollment <- red_excel("./class_enrollment_summary_by_term2.18.20.xlsx", skip = 3) %>% clean_names() %>% filter(!is.na(course_name))
#> Error in red_excel("./class_enrollment_summary_by_term2.18.20.xlsx", skip = 3) %>% : could not find function "%>%"

Created on 2020-02-18 by the reprex package (v0.3.0)

x <- read_xlsx("class_enrollment_summary_by_term_2.11.20.xlsx", skip = 3) 
#> Error in read_xlsx("class_enrollment_summary_by_term_2.11.20.xlsx", skip = 3): could not find function "read_xlsx"
top_dep <- x %>%
  group_by(`Course Department`) %>%
  summarize(sum = sum(Total)) %>%
  arrange(desc(sum)) %>%
  slice(1:5)
#> Error in x %>% group_by(`Course Department`) %>% summarize(sum = sum(Total)) %>% : could not find function "%>%"

Created on 2020-02-18 by the reprex package (v0.3.0)

enrollment <- read_excel("class_enrollment_summary_by_term2.18.20.xlsx", skip = 3) %>% 
  clean_names()
#> Error in read_excel("class_enrollment_summary_by_term2.18.20.xlsx", skip = 3) %>% : could not find function "%>%"

Created on 2020-02-18 by the reprex package (v0.3.0)

read_excel(path = "class_enrollment_summary_by_term2.18.20.xlsx", 
    skip = 3) %>% clean_names() %>% select(course_department, 
    total) %>% arrange(desc(total))
#> Error in read_excel(path = "class_enrollment_summary_by_term2.18.20.xlsx", : could not find function "%>%"

Created on 2020-02-18 by the reprex package (v0.3.0)

x <- read_excel("class_enrollment_summary_by_term_2.13.20.xlsx", skip =3) 
#> Error in read_excel("class_enrollment_summary_by_term_2.13.20.xlsx", skip = 3): could not find function "read_excel"

Created on 2020-02-18 by the reprex package (v0.3.0)

enrollment <- read_excel("enrollment_2020_02_18.xlsx", skip = 3) %>%
clean_names()
#> Error in read_excel("enrollment_2020_02_18.xlsx", skip = 3) %>% clean_names(): could not find function "%>%"
read_excel("class_enrollment_summary_by_term2.18.20.xlsx", skip = 3)
#> Error in read_excel("class_enrollment_summary_by_term2.18.20.xlsx", skip = 3): could not find function "read_excel"

Created on 2020-02-18 by the reprex package (v0.3.0)

x <- read_excel(file = "class_enrollment_summary_by_term2.18.20.xlsx")
#> Error in read_excel(file = "class_enrollment_summary_by_term2.18.20.xlsx"): could not find function "read_excel"
``` r
x <- read_excel(path = "class_enrollment_summary_by_term_2.18.20.xlsx", 
    skip = 3)
#> Error in read_excel(path = "class_enrollment_summary_by_term_2.18.20.xlsx", : could not find function "read_excel"

Created on 2020-02-18 by the reprex package (v0.3.0)

enrollment_data <- read_excel("class_enrollment_summary_by_term2.18.20.xlsx", skip = 3) %>%
  clean_names() %>%
  select(course_department, total) %>%
  arrange(desc(total)) %>%
  enrollment_data[-c(1)]
#> Error in read_excel("class_enrollment_summary_by_term2.18.20.xlsx", skip = 3) %>% : could not find function "%>%"
enrollment_data <- read_excel("class_enrollment_summary_by_term2.18.20.xlsx", skip = 3)
#> Error in read_excel("class_enrollment_summary_by_term2.18.20.xlsx", skip = 3): could not find function "read_excel"

Created on 2020-02-18 by the reprex package (v0.3.0)