I would like to add a fill aesthetic to an autoplot function. Specifically, to the autoplot.conf_mat
function from the yardstick
package.
library(tidyverse)
library(tidymodels)
data("hpc_cv")
cm <- hpc_cv %>%
filter(Resample == "Fold01") %>%
conf_mat(obs, pred)
cm
#> Truth
#> Prediction VF F M L
#> VF 166 33 8 1
#> F 11 71 24 7
#> M 0 3 5 3
#> L 0 1 4 10
autoplot(cm, type = "mosaic")
Created on 2020-11-20 by the reprex package (v0.3.0)
QUESTION: How can I add a fill
aesthetic to either the Truth
or Prediction
factor? That is, add some color to the different categories.
I have tried + scale_fill_manual
and other variants, but I do not believe a fill
aesthetic is being utilized in the autoplot
call.