RE: [R] Tool for update

From: Andy Bunn <>
Date: Sat 23 Apr 2005 - 03:52:27 EST

Hi Ronaldo: First, this script was discussed a few days ago. Note that under 2.1 update.packages() has changed for the better. Look at the NEWS file.

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

you'll have 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)? ") <- as.character(readLines(n = 1))     if (any( == "y", == "Y"))     {

        cat("This can take a few seconds...\n")


Second, you wrote:

> I make a little adapt to this script and try to use.
> But, when a file dont exist, the installation is aborted.

If you really need to automate this and use download.file then look at using try() to catch errors. I suggest you look at the file structure of the src/contrib folder at CRAN and modify your code if you need to. For instance, point to src/contrib/assist_1.0.tar.gz and not assist_0.1.2.tar.gz as the source version is now 1.0 for assist.

But, as mentioned earlier, it would be better to move this all to a chron job.

HTH, Andy mailing list PLEASE do read the posting guide! Received on Sat Apr 23 03:57:39 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:22 EST