Nerd post: Installing R packages remotely and without priviliges, thereby salvaging xgrid

I’m distributing jobs and had a bit of trouble with my scripts. I don’t want to go to every computer on the cluster one-by-one to get the right scripts on them, and we’ve turned ssh off, and it’ll take going to each one to turn it on. Plus what if a later script needs different libraries? This pretty simple (*nix-/OSX-only) snippet installs the package if you don’t already have it, and it works even if xgrid is chugging without special privileges:
if (!("urpackagehere" %in% installed.packages())) {install.packages("urpackagehere", repos = "", lib="/tmp/")}


This entry was posted on Thursday, February 28th, 2013 and is filed under straight-geek.