heat_map: Create graphics for one or more confusion matrices

View source: R/conf_mat.R

heat_mapR Documentation

Create graphics for one or more confusion matrices

Description

Create graphics for one or more confusion matrices

Usage

heat_map(x, title = NULL, title_col = 1, proportions = TRUE, annotate = TRUE)

Arguments

x

conf_mat confusion matrix OR a tibble with a conf_mat list column

title

character or NULL, for the plot title

title_col

character or integer, the column from which to draw the title when providing a data frame of confusion matrices

proportions

logical if TRUE annotate with proportions (as percentages)

annotate

logical if TRUE annotate with a caption of stats (acc, sens, spec)

Value

ggplot object ala conf_mat

Examples

## Not run: 
 library(dplyr)
 data("hpc_cv")
 cm <- dplyr::as_tibble(hpc_cv) |>
   dplyr::filter(Resample %in% sprintf("Fold%0.2i", 1:4)) |>
   dplyr::group_by(Resample) |>
   yardstick::conf_mat(obs, pred)
 gg <- heat_map(cm)
 patchwork::wrap_plots(gg, ncol = 2)

## End(Not run)

BigelowLab/calanusthreshold documentation built on May 12, 2022, 5:06 a.m.