R/run_audit.R

Defines functions run_audit

Documented in run_audit

#' Run audit
#'
#' @param df data frame of marks
#' @param mark_col colname of column with final marks
#' @param width width of band to filter on
#' @param boundary vector of boundary points. 
#'
#' @return nothing - just prints to screen cases to check. 
#' @export
#'
#' @examples
#' data(SMI_2018_marks_clean)
#' SMI_2018_marks_clean
#' run_audit(SMI_2018_marks, Total)
run_audit  <- function(df, mark_col, width = 1, boundary = c(50, 65, 75, 85)){
  for(i in boundary){
    cat("Boundary:", i, "\n")
    df %>% 
      filter({{mark_col}} <= i + width, {{mark_col}} >= i - width) %>% 
      print(n = 100)
  }
}
jonotuke/examMarking documentation built on Nov. 26, 2019, 3:48 p.m.