[R] loading an updated version of a package during an active R session?

From: Roger Levy <rlevy_at_ucsd.edu>
Date: Wed, 09 Apr 2008 15:26:12 -0700


I am developing a package and I want to be able to load an updated version of the package from within an active R session. Suppose, for example, I have a function f within a package X. In my active R session, I have already loaded X. Then I change the R source code of f within X and rebuild the package as a .tar.gz file on the command line with

   R CMD build X

Within my R session, is there a way to reload X such that the updated definition of f will be used? I have tried:

> detach("package:X")
> install.packages("X.tar.gz", repos=NULL, type="source")
> library(X)

but this seems to use the old version of f. Any suggestions would be much appreciated!

Many thanks in advance!

Roger



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. Received on Wed 09 Apr 2008 - 22:48:33 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 10 Apr 2008 - 05:30:32 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive