Hi, I think we need to load library(scales) for plotting Figure 6.6 (confusion matrix).
When I ran the current code, the error is
Error in check_breaks_labels(breaks, labels) : object 'percent_format' not found
Since percent_format is a function inside the scales library,
scale_fill_gradient2(high='red', labels = percent_format())
should be corrected as
scale_fill_gradient2(high='red', labels = scale::percent_format())
or
library(sclaes)scale_fill_gradient2(high='red', labels = percent_format())
Thanks for the feedback @liu431! 🙌 The scales packages was loaded in the setup chunk previously but it is likely more helpful to load it in a visible chunk here.
Hi, I think we need to load
library(scales)
for plotting Figure 6.6 (confusion matrix).When I ran the current code, the error is
Since percent_format is a function inside the scales library,
scale_fill_gradient2(high='red', labels = percent_format())
should be corrected asscale_fill_gradient2(high='red', labels = scale::percent_format())
orlibrary(sclaes)
scale_fill_gradient2(high='red', labels = percent_format())