[R] install.packages, update.packages

kjetil brinchmann halvorsen kjetil at entelnet.bo
Sat May 3 03:44:24 CEST 2003


Hola!

I am using update.packages() from the menu in Rgui (windows XP), and 
have a little problem. Sometimes the function terminates prematurely, 
for example because of some problems with one of the files it tries 
to download and install. In this case update.packages does not ask
if the downloaded packages should be deleted, and so I cannot answer 
N and have the tempdir location printed. I always store the 
downloaded files in a place to burn CD's to take to other machines, 
so I need this information. 

The relevant code is in install.packages, and I would like if the 
code fragment therefrom

if (!localcran && is.null(destdir)) {
            answer <- substr(readline("Delete downloaded files (y/N)? 
"), 
                1, 1)
            if (answer == "y" | answer == "Y") {
                for (file in foundpkgs[, 2]) unlink(file)
                unlink(tmpd)
            }
            else cat("The packages are in", tmpd)
            cat("\n")
        }


could be put into an on.exit(, add=TRUE) call. 

Also, in this situation, the packages already downloaded succefully, 
will not be installed, so at least to know where they are help in 
installing them from the local zip file, or could this part to be put 
into a call to on.exit() ?

Kjetil Halvorsen



More information about the R-help mailing list