#' 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)
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.