[R] update R packages in local repos

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Nov 17 08:27:23 CET 2005


On Wed, 16 Nov 2005, P Ehlers wrote:

> This should work:
>
> update.packages(ask = "graphics", repos = NULL,
>     contriburl = "file:///g:/myFolder/myRepository"))

Only if the so-called repository contains (only) binary builds under R 
2.2.x of packages for Windows.

It would be better to set up the 'repository' correctly as a repository. 
See my article in R-news 5/1 and the R-admin manual for the format of a 
repository.

>
> -peter
>
> Muhammad Subianto wrote:
>> I try to update R packages via my local repository.
>> I put all R packages in g:/myFolder/myRepository, I do like

Are these source packages or binary packages or what?

>>> library(tools)
>>> write_PACKAGES("g:/myFolder/myRepository")
>>> options(repos=c(LocalR="file://g:/myFolder/myRepository"))
>>> getOption("repos")
>>
>>                            LocalR
>> "file://g:/myFolder/myRepository"

Your syntax is incorrect here: Peter has silently corrected it.
file:// syntax has an element for 'machine' followed by a third slash
(although 'machine' is not supported in R, so it should be empty).

>>> update.packages(ask = "graphics")
>>
>> Error in gzfile(file, "r") : unable to open connection
>> In addition: Warning message:
>> cannot open compressed file
>> ':/myFolder/myRepository/bin/windows/contrib/2.2/PACKAGES'
>>
>>> ?update.packages
>>
>>
>> It produces these file in g:/myFolder/myRepository
>> PACKAGES
>> PACKAGES.gz
>>
>> Could I make this folder (bin/windows/contrib/2.2/)? Why?

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list