I am wanting to change some lines of code in the R package named "nlme" http://cran.r-project.org/web/packages/nlme/index.html To do this I have downloaded the Package source named nlme_3.1-96.tar.gz, opened up the file and changed the text documents within the folder named R, specifically the cor.Struct.txt file. I now want to know how can I use this modified nlme_3.1-96.tar.gz file in R 2.10. How do I convert this source code into a package? I have looked on the internet and tried using cmd.exe then the code Rmcd.exe INSTALL -1 ~/nlme_3.1-96.tar.gz I end up getting the message "The system can't find the specified path", when I have the file in the directory that Rmcd.exe is in. -- View this message in context: http://r.789695.n4.nabble.com/Changing-downloaded-source-code-into-a-package-tp2318559p2318559.html Sent from the R help mailing list archive at Nabble.com.
Gabor Grothendieck
2010-Aug-09 17:29 UTC
[R] Changing downloaded source code into a package
On Mon, Aug 9, 2010 at 10:22 AM, JH <dealing_with_doors at hotmail.com> wrote:> > I am wanting to change some lines of code in the R package named "nlme" > http://cran.r-project.org/web/packages/nlme/index.html > To do this I have downloaded the Package source named nlme_3.1-96.tar.gz, > opened up the file and changed the text documents within the folder named R, > specifically the cor.Struct.txt file. > I now want to know how can I use this modified nlme_3.1-96.tar.gz file in R > 2.10. How do I convert this source code into a package? > > > I have looked on the internet and tried using cmd.exe ?then the code > Rmcd.exe INSTALL -1 ~/nlme_3.1-96.tar.gz > I end up getting the message "The system can't find the specified path", > when I have the file in the directory that Rmcd.exe is in.Assuming you have installed Rtools and have the R bin directory and the Rtools bin directory on your path cd to.wherever.your.tar.gz.file.is.located Rcmd INSTALL nlme_3.1-9.96.tar.gz Alternately, at http://batchfiles.googlecode.com is a file Rcmd.bat that you can call which will find Rtools and R in the registry and then run Rcmd.exe so you don't have to add anything to your path. In that case you just place Rcmd.bat somewhere on your existing path and don't have to change your path at all.
See comments below. On Mon, 2010-08-09 at 10:22 -0400, JH wrote:> I am wanting to change some lines of code in the R package named "nlme" > http://cran.r-project.org/web/packages/nlme/index.html > To do this I have downloaded the Package source named nlme_3.1-96.tar.gz, > opened up the file and changed the text documents within the folder named R, > specifically the cor.Struct.txt file.I couldn't find this file. Do you mean corStruct.R, or maybe corStruct.c?> I now want to know how can I use this modified nlme_3.1-96.tar.gz file in R > 2.10. How do I convert this source code into a package?The source code, along with the documentation, data files, etc. _is_ the package. When the package contains source code from a compiled language (C or Fortran), as nlme does, this code must be compiled for your platform before the package is installed. The CRAN maintainers kindly pre-compile this code for Windows and Mac OS X users. If you make modifications to C or Fortran code in a package, you must re-compile the code yourself, or use a service such as R-Forge. The R manual `Writing R Extensions` is the standard reference for packages. See also the `R Administration and Installation' manual. See the information here http://www.murdoch-sutherland.com/Rtools/ for compiling package code in Windows. Lastly, before you follow the instructions at the URL above, I urge you to consider GNU Linux as a platform for programming. I've found the tools available in standard GNU Linux distributions (such as that available at http://www.debian.org) much simpler to install and work with.> > > I have looked on the internet and tried using cmd.exe then the code > Rmcd.exe INSTALL -1 ~/nlme_3.1-96.tar.gz > I end up getting the message "The system can't find the specified path", > when I have the file in the directory that Rmcd.exe is in. > >-- Matthew S. Shotwell Graduate Student Division of Biostatistics and Epidemiology Medical University of South Carolina
On 09/08/2010 10:22 AM, JH wrote:> I am wanting to change some lines of code in the R package named "nlme" > http://cran.r-project.org/web/packages/nlme/index.html >That is usually a bad idea. If you have found a bug in the package, let the maintainers know about it. If you want to add to it, write your own package that makes use of nlme. If you start editing the package yourself, then quickly you'll end up being cut off from bug fixes and enhancements when the next version comes out. For instructions on installing a source package, see the Writing R Extensions manual. Duncan Murdoch> To do this I have downloaded the Package source named nlme_3.1-96.tar.gz, > opened up the file and changed the text documents within the folder named R, > specifically the cor.Struct.txt file. > I now want to know how can I use this modified nlme_3.1-96.tar.gz file in R > 2.10. How do I convert this source code into a package? > > > I have looked on the internet and tried using cmd.exe then the code > Rmcd.exe INSTALL -1 ~/nlme_3.1-96.tar.gz > I end up getting the message "The system can't find the specified path", > when I have the file in the directory that Rmcd.exe is in. > > >