dgrtwo / tidy-text-mining

Manuscript of the book "Tidy Text Mining with R" by Julia Silge and David Robinson
http://tidytextmining.com
Other
1.31k stars 803 forks source link

Need load scales library for Figure 6.6. #71

Closed liu431 closed 4 years ago

liu431 commented 4 years ago

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())

juliasilge commented 4 years ago

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.