Create A Backup Script for Your R Packages

So today I was playing around with the installed.packages() function, and I thought to myself:
Boy wouldn’t it be a jolly good time to make some kind of backup script from this?

The idea is …