R/teacher_performance_report.R

Defines functions teacher_performance_update

Documented in teacher_performance_update

#' @title Teacher Performance Update
#'
#' @description a wrapper around several plots that helps show key teacher 
#' performance statistics
#'
#' @param mapvizieR_obj mapvizieR object
#' @param studentids target students
#' @param measurementscale target subject
#' @param start_fws starting season
#' @param start_academic_year starting academic year
#' @param end_fws ending season
#' @param end_academic_year ending academic year
#' @param title_text what is this report called?
#' @param ... additional arguments
#'
#' @return prints a ggplot object
#'
#' @export

teacher_performance_update <- function(
  mapvizieR_obj, studentids, measurementscale,
  start_fws, start_academic_year, end_fws, end_academic_year,
  title_text = '',
  ...
) {

  minimal = grid::rectGrob(gp = grid::gpar(col = "white"))

  title_bar <- h_var(paste0('Teacher Performance Update: ', title_text), 24)

  #elephants
  ele <- galloping_elephants(mapvizieR_obj, studentids, measurementscale)

  #histogram
  growth_hist <- growth_histogram(
    mapvizieR_obj = mapvizieR_obj,
    studentids = studentids,
    measurementscale = measurementscale,
    start_fws = start_fws,
    start_academic_year = start_academic_year,
    end_fws = end_fws,
    end_academic_year = end_academic_year
  )

  gridExtra::arrangeGrob(
    title_bar, ele, growth_hist,
    nrow = 3, heights = c(1, 4, 4)
  )
}
almartin82/mapvizieR documentation built on May 10, 2018, 11:59 p.m.