Sometimes you may not like the default values of knitr’s chunk options, and you know how to change them (i.e., knitr::opts_chunk$set()), but it can be tedious to do it for every single document. How can we change default chunk options globally in a system?

One approach is to set these options in your .Rprofile, if you know what this file is and how to edit it. However, this approach has a drawback—it will load knitr for any R session, even if you do not need to use knitr