How to synchronise your R libraries between different PCs

I am using my R on a few computers (sometimes in the same time) and I do find it annoying when some libraries which I installed on one are missing on other. My usual solution was to use Dropbox and synchronise between my accounts. With R I had a problem, as defining library location required changes directly to R, hidden behind RStuido. I was in hurry so I gave up.

Recently, I have found stackoverflow solution and this blog post which made me re-visit problem again. Workflow below, shows my current solution:

# set library paths
.libPaths(.libPaths()[2])

[^]: note that I use Unix path notation despite using windows. R always use Unix notation, regardless of operating system. Also don’t add final “".

If you liked this post, you can Tweet about it or Follow me on Twitter