Recommended practice for installing projects and packages on different computer

packrat will help you do that on a project level allowing easy deployment on the project on a new Environnement.

Shortly, it will infer the package dependency of the Project and generate a lock file describing what your project need. It will also put the package version sources in the project and then install them in a project library from this sources.
packrat::snapshot helps maintain the locked file up to date, packrat::restore helps with restauring everything from the locked file easily.

As everything your project need is in the project folder, packrat::bundle allows you to make a compressed bundle of your project (code + package sources). You can take this bundle on another computer then use packat::unbundle and restore.

Pretty easy to use with default behavior. You can customize it but it requires more work.

I can be used with github to transfer project without making a bundle. The packrat.lock file is the most important.

On a system level, I find pkgsnap useful and easier. It helps you snapshot you current packages environnement on your system in a text file. Then you can restore this snapshot from the text file on another computer easily to install the exact same version of package.
Sometimes you just need to recreate a work environment and it is enough.

This two solutions helps me transfer project or deploy project on new Environnement.

5 Likes