Brian S Cade
2005-Nov-22 15:35 UTC
[R] modifying code in contributed libraries - changes from versions 1.* to 2.*
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 U. S. Geological Survey Fort Collins Science Center 2150 Centre Ave., Bldg. C Fort Collins, CO 80526-8818 email: brian_cade@usgs.gov tel: 970 226-9326 [[alternative HTML version deleted]]
Jari Oksanen
2005-Nov-22 16:35 UTC
[R] modifying code in contributed libraries - changes from versions 1.* to 2.*
On 22 Nov 2005, at 17:35, 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 think the best way of fixing problems is to send your edited code to the package maintainer so that she (or he) can fix it now and in the future versions. If you want to fix the problem only privately, you may consider making your private package from your private fixes of functions from public CRAN package(s), and load that when you need.> 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 > > U. S. Geological Survey > Fort Collins Science Center > 2150 Centre Ave., Bldg. C > Fort Collins, CO 80526-8818 > > email: brian_cade at usgs.gov > tel: 970 226-9326 > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html >-- Jari Oksanen, Oulu, Finland
Uwe Ligges
2005-Nov-22 16:44 UTC
[R] modifying code in contributed libraries - changes from versions 1.* to 2.*
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.Due to lazy loading (see a corresponding R News article) code is stored in databases for some time now, if you are looking into binary packages. In order to modify/fix something, download the source version of a package, change the code, and INSTALL the source package. Uwe Ligges> Brian > > Brian S. Cade > > U. S. Geological Survey > Fort Collins Science Center > 2150 Centre Ave., Bldg. C > Fort Collins, CO 80526-8818 > > email: brian_cade at usgs.gov > tel: 970 226-9326 > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Martyn Plummer
2005-Nov-22 16:48 UTC
[R] modifying code in contributed libraries - changes from versions 1.* to 2.*
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. CadeThese 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}}