R/initialize_assignment.R

Defines functions initialize_assignment

Documented in initialize_assignment

#' Initialize assignment
#'
#' @param assignment
#'
#' @return
#' @export
#'
#' @examples
initialize_assignment = function(grade_spreadsheet = "p8105_grades.xlsx", assignment) {

  fs::dir_create(here::here("emails", stringr::str_c("p8105_", assignment)))
  fs::dir_create(here::here("emails", stringr::str_c("p8105_", assignment), "comments"))

  sheet = read_excel(grade_spreadsheet, sheet = assignment) %>%
    filter(!is.na(ID)) %>%
    mutate(assignment = assignment) %>%
    select(assignment, everything())

  sheet

}
P8105/p8105.helpers documentation built on Sept. 15, 2022, 9:31 p.m.