Skip to content

update packages from local

7 messages · Wayne (Yanwei) Zhang, Uwe Ligges, David Winsemius +1 more

#
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.
#
On Jan 3, 2010, at 11:08 AM, Wayne (Yanwei) Zhang wrote:

            
I thought that the library() function checks to see if it's argument  
is already loaded and ignores the command if it is. I think you need  
to restart R to see if you update was successful.
#
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
#
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:
#
On Jan 3, 2010, at 12:42 PM, Wayne (Yanwei) Zhang wrote:

            
Apparently not.

I'm not an expert at this so it's perfectly possible that someone  
smarter could look at your first email and tell you what went wrong,  
although it seemed lacking in several details.  If I were you, I would  
be checking to see what my .libPaths value was, perhaps using a  
destdir argument and not trusting the value of working directory to  
determine where the source was coming from, but instead specifying  
absolute paths. You might consider an "oldPkgs" argument.

(You might consider including the results of sessionInfo() and the  
beginning and ending of the compilation output, and I would also not  
be trimming the email chain.)
David Winsemius, MD
Heritage Laboratories
West Hartford, CT
#
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. 

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.
is
guide.html
Regards,
Wayne (Yanwei) Zhang
#
On Sun, 3 Jan 2010, Wayne (Yanwei) Zhang wrote:

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