For RStudio the chosen way of storing packages with each project codebase is the use of a tool called 'packrat'. This allows all of the packages associated with a script or set of scripts to be saved within a project area. Some of the background and reasons for using packrat can be found here - https://rstudio.github.io/packrat/, but within DataLabs is allows us to keep all user content - code, data & packages within the project volumes for persistence as well as reproducibility.
When creating a new project with RStudio, there is now a selection for "Use packrat for this project", by selecting this RStudio will take care of initializing packrat in the project directory, as well as ensuring that any further packages installed in that area will be kept locally with the code itself.
If instead of a new project you wish to add packrat management to a current project, this is possible by selecting the directory from the file browser and editing the settings to enable packrat as below (under Tools > Project Options).