R/plot_cutoff_table.r

#' Plot Cutoff Table
#'
#' This function loads a file as a matrix. It assumes that the first column
#'
#' @param cutoff_table A cutoff table as generated by the generate_cutoff_table function/
#' @return A ggplot of the percentage of observations that are greater than the cutoff.
#' @export
plot_cutoff_table <- function(cutoff_table){
  p <- ggplot2::ggplot(cutoff_table, ggplot2::aes(x=cutoff, y=fraction_smaller_than_cutoff, group=1)) +
    ggplot2::geom_line() +
    ggplot2::xlab('Cutoff') +
    ggplot2::ylab('Fraction of input > cutoff') +
    ggplot2::ggtitle('Cumulative percentage of input > cutoff') + ggplot2::theme_bw()
  return(p)
}
walternewzoo/guillotine documentation built on May 6, 2019, 12:26 p.m.