Last week I had to do update R on my work computer, it turned into a rather painful task which took me the best part of the day and resulted in me wanting to rage-quit several times!
I was naive and didn't think about my packages and because I was doing a major update (going from version 3.4.something to 3.5.1) I needed to re-install all of my packages but I had no complete list of the packages that I had been using.
Only after I had gone through this pain did someone tell me about the `installR` package which probably could have saved me a whole heap of time! A couple of days later whilst at home I made the time to install the update on my laptop, I then discovered that the `installR` package is not available for MacOS :(
I did however find a relatively straightforward solution which I am documenting here in case future me needs to use this method again. I'm sure there are much better ways of doing this but this one worked for me.
I used the `updateR` package which I came across thanks to this blog post
The updateR package is great but it is still in development and there seem to be some bugs with the `needed packages` function - which was kinda the whole reason for using this package in the first place so I modified my workflow slightly
This works for all CRAN packages but it failed for github packages because the syntax of librarian::shelf requires that the github username prefixes the package name, fortunately when librarian failed to load these packages it listed the names of all of them in the error message so it was easy for me to manually reinstall them.