I edited Rprofile to update everything on Tuesdays. I've been doing this
since 2.0 and I think I've had R running almost every Tuesday, which begs
the question of what I would be doing if R hadn't come into existence.
In any case, It works pretty well:
## This script gets all the packages I don't already have
# Run this once a week - say Tuesdays
if (interactive() ) { library(utils)}
is.tuesday <- as.POSIXlt(Sys.time())$wday == 2
if (is.tuesday == T)
{
cat("Running a package check...\nOccurs once a week, on Tuesdays\n")
cat("Upgrade existing packages and check for new packages (y/N)? ")
check.new <- as.character(readLines(n = 1))
if (any(check.new == "y", check.new == "Y"))
{
options(CRAN = "http://cran.us.r-project.org/")
cat("This can take a few seconds...\n")
x <- packageStatus(repositories = getOption("repositories")()[[1]])
print(x)
install.packages(x$avail$Package[x$avail$Status == "not
installed"]) cat("Upgrading to new versions if available\n")
upgrade(x)
}
}