[R] update packages from local

Prof Brian Ripley ripley at stats.ox.ac.uk
Sun Jan 3 21:33:46 CET 2010


On Sun, 3 Jan 2010, Wayne (Yanwei) Zhang wrote:

> Sorry. The original message is below.
>
> Uwe, do you mean if i just want to update the old package abc, i have to run "R
> INSTALL abc_0.1.1.tar.gz" in the shell? I know that will overwrite that package,
> but can I do something with the update.packages() function within R? From what
> I read in the documentation, update.packages() seems to work for local source
> file update as well.

You read incorrectly: install.packages() works with local files, but 
to *update* you need to use a repository (which can be on your disc, 
but needs to have a PACKAGES or PACKAGES.gz file).

      The main function of the set is ‘update.packages’.  First a list
      of all packages/bundles found in ‘lib.loc’ is created and compared
      with those available at the repositories. ...

>
> Anybody any advice?
>
> Thanks
>
>
>
>
>
> ---- Original message ----
> Hi all,
> I have an old package installed, say "abc". Now I made some changes to the
> source,
> and built a new version of the source code "abc_0.1.1.tar.gz". How can I update
> the
> old package to this newer version from the local tar.gz file? I was running the
> following, but it did not work.
>
> setwd("directory where the tar.gz file locates")
>
> update.packages(repos=NULL,pkgs="abc_0.1.1.tar.gz",type="source")
>
> The code runs, but when I load library(abc) again, it is still the old version...
> What
> did I miss here?  Thanks.
>
>> Date: Sun, 03 Jan 2010 18:55:44 +0100
>> From: Uwe Ligges <ligges at statistik.tu-dortmund.de>
>> Subject: Re: [R] update packages from local
>> To: "Wayne (Yanwei) Zhang" <actuaryzhang at uchicago.edu>
>> Cc: David Winsemius <dwinsemius at comcast.net>, r-help at r-project.org
>>
>> 1. Please quote the old threat, at least I do not keep old messages.
>> 2. Try install.packages() from a freshly started R (that has not loaded
>> the package in advance).
>> 3. Since I am doing things in the shell for package development anyway,
>> I tend to call package installation from the shell as well:
>>
>> R CMD INSTALL foo_x.y-z.tar.gz
>>
>> Uwe Ligges
>>
>>
>>
>> Wayne (Yanwei) Zhang wrote:
>>> Thanks. But I after I restarted R, it is still the old version of the package that
> is
>>> loaded. Am I using the update.packages() correctly?
>>> Regards,
>>> Wayne (Yanwei) Zhang
>>>
>>> ______________________________________________
>>> R-help at r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>> PLEASE do read the posting guide http://www.R-project.org/posting-
> guide.html
>>> and provide commented, minimal, self-contained, reproducible code.
> Regards,
> Wayne (Yanwei) Zhang
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

-- 
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