Skip to content
Prev 68026 / 398521 Next

automatic updating

The Tuesday update script came back to get me! I knew it would.

update.packages has changed (for the better) with this release. Look at the
NEWS file:

	The 'CRAN' argument to update.packages(), old.packages(),
	new.packages(), download.packages() and install.packages() is
	deprecated in favour of 'repos',

and...
      There is a new possible value update.packages(ask="graphics")

and...


      update.packages() and old.packages() have a new option
	'checkBuilt' to allow packages installed under earlier
	versions of R to be updated

So, if you want to keep updating on Tuesdays, despite sensible advice to the
contrary offered in this thread

http://finzi.psych.upenn.edu/R/Rhelp02a/archive/48390.html

you'll hvae to change the script to something like this:

# 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"))
    {
        cat("This can take a few seconds...\n")
        update.packages(ask=FALSE)
   }
}

But, you should change this to a chron job.

HTH, Andy