[R] update R packages in local repos
Muhammad Subianto
subianto at gmail.com
Thu Nov 17 11:16:53 CET 2005
Thanks you.
Now, I can install and update some packages from local repos.
I put all R packages (zip files, using W2K)
in h:/myFolder/myRepository,
library(tools)
write_PACKAGES("h:/myFolder/myRepository")
options(repos=c(LocalR="file:///h:/myFolder/myRepository"))
getOption("repos")
install.packages(lib=.libPaths()[3],
repos=NULL,
contriburl="file:///h:/myFolder/myRepository")
instead of
install.packages(choose.files('',filters=Filters[c('zip','All'),]),
.libPaths()[3], repos = NULL)
where .libPaths()[3] my local library (added in Renviron.site) and
update with
update.packages(ask="graphics",
repos=NULL,
contriburl="file:///h:/myFolder/myRepository")
Best, Muhammad Subianto
Cited:
- R News 5/1
- C:\Program Files\R\R-2.2.0\library\utils\html\update.packages.html
On this day 17/11/2005 08:27 AM, Prof Brian Ripley wrote:
> 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?
>
>
More information about the R-help
mailing list