Using Packrat with a project
During the creation of our package, we saw the option to use Packrat with this project. Packrat is a very important tool when you make your package as reproducible as possible. It basically stores all the packages needed and so creates a private package library. When you load this package, R will automatically restore the needed packages from this private library.
We can set up our project to use Packrat right when you create it. In the dialogue box we just have to check the Use packrat with this project checkbox. RStudio will then set up our private library and fill it with the packages.
When we look at the package pane, we can see the content of our packrat library. This private library has an extra column showing the version included in the private library and the source of this library.
In the screenshot, there are also packages included in the private library because Packrat was turned on in an existing project. You can do this in the project options by checking...