I'm using packrat for the first time in R, what's the best way to install Rstudio addins?
To use the styler package for example, I can run install.packages("styler") and make sure it is not added to the snapshot. Is this the recommended solution, or is there a way to install a package globally so that all projects can use it - similar to the global flag when using npm install?
This is a great question, and an interesting use case - thanks! So part of packrat's functionality is that it specifically isolates you from the "global" environment, lest you pick up a package that you are not intending and get unexpected behavior / unreproducible results.
An "external package" is one that will be loaded from your user environment, but not acknowledged / recorded in the packrat.lock file.
Note that a "newer" version of packrat has been created, in case it interests you. It is called renv and it has similar functionality, along with some noteworthy improvements. Let us know if you have any more questions or any issues with this approach!