[R] modifying code in contributed libraries - changes from versions 1.* to 2.*

Martyn Plummer plummer at iarc.fr
Tue Nov 22 17:48:04 CET 2005


On Tue, 2005-11-22 at 08:35 -0700, Brian S Cade wrote:
> Having finally updated from R 1.91 to R 2.2.0 with my installation of a 
> new computer, I discovered that something has changed drastically about 
> the way code for contributed packages is stored when installed in a local 
> version of R.  In the 1.* versions it was easy for me to go in and modify 
> some of the code for a contributed package by using a text editor to 
> change the script files (these were the files usually stored under the 
> package name\R folder).  Now under R 2.2 when I look at the same location 
> (package name\R folder) there are 3 files, one with no extension, one with 
> .rdb extension, and one with a .rdx extension and none of these seem to be 
> text files that can be easily edited (at least not as I did before).  Now 
> I know I can edit a specific function after I've loaded a package into a 
> specific workspace, but I would like to edit the contributed package so 
> that anytime I load it the changes I've made are implemented.  While I'm 
> not generally in the habit of modifying other peoples code, when I find a 
> problem that I know how to fix, I'ld like to fix it - once.  I suspect I'm 
> missing something pretty obvious about how to edit these but my search of 
> the online documentation, etc. didn't suggest any simple approach like I 
> use to do.  Any help would be welcome.
> 
> Brian
> 
> Brian S. Cade

These changes were introduced in R 2.0.0 to enable lazy loading of
objects in packages.  There is an article by Brian Ripley explaining the
changes in the September 2004 issue of R news (Vol 4/Issue 2), which you
can find here:

http://cran.r-project.org/doc/Rnews/

You can still modify source packages, but for this to be useful you must
have the capability to build binary packages yourself. If you are using
Windows, this might be hard.  If your change is a bug fix, rather than a
personal modification, then your best bet is to send an email to the
package maintainer. 

Martyn


-----------------------------------------------------------------------
This message and its attachments are strictly confidential. ...{{dropped}}




More information about the R-help mailing list