H Patrick Giraudoux
2004-Nov-07 14:34 UTC
[R] writing a simple package in R 2.0 under Windows XP
Dear listers, I have developped a set of functions that I would like to package on a Windows XP plateform for some friends (this would be more simple than to deliver them as a source text file without handy help). I am working under Windows XP. Of course I have gone through the manual "Writing R extension" and try to sort out what a most simple "packaging" for beginner (without compiled code, etc...) could be. I also read http://www.rap.ucar.edu/staff/ericg/RWinBuild.html It is very easy to build R packages in Windows (for Windows)... Perl has been installed and works fine C:\Perl (source http://www.activestate.com/Products/ActivePerl/Download.html). R Tools have been installed: C:\Perl\Rtools (source: http://www.murdoch-sutherland.com/Rtools/tools.zip) R tools functions delivered work fine (ex: ls, etc...) R has been installed "at the root" of C:\ to avoid any blank in directory names: C:\R\rw2000 The PATH has been defined as environment variable in Windows XP as: C:\Perl\Rtools;C:\Perl\bin;...;C:\R\rw2000\bin A trial package named "AnExample" has been prepared as indicated in the example of package.skeleton() of the library "utils" and put in C:\ from there I have typewritten: C:\>RCMD build AnExample With this result: Can't open perl script "C:\R\rw2000/bin/build": No such file or directory I could catch that indeed 'build.exe' does not exist in this directory (which is true...) and tried to find it somewhere on my c: disk. Unfortunately, this 'build' or 'build.exe' file does not exist nor a 'check' file, nor any complementary command of Rcmd After some research hours (actually since yesterday...), I cannot find where I have got wrong yet... and considering the result, I am sure I got somewhere! Can somebody help me on this? Thanks in advance, Patrick Giraudoux [[alternative HTML version deleted]]
Gabor Grothendieck
2004-Nov-07 14:52 UTC
[R] writing a simple package in R 2.0 under Windows XP
H Patrick Giraudoux <patrick.giraudoux <at> univ-fcomte.fr> writes: : : Dear listers, : : I have developped a set of functions that I would like to package on a : Windows XP plateform for some friends (this would be more simple than to : deliver them as a source text file without handy help). I am working under : Windows XP. : : Of course I have gone through the manual "Writing R extension" and try to : sort out what a most simple "packaging" for beginner (without compiled : code, etc...) could be. I also read : http://www.rap.ucar.edu/staff/ericg/RWinBuild.html It is very easy to build : R packages in Windows (for Windows)... : : Perl has been installed and works fine C:\Perl (source : http://www.activestate.com/Products/ActivePerl/Download.html). : R Tools have been installed: C:\Perl\Rtools (source: : http://www.murdoch-sutherland.com/Rtools/tools.zip) : R tools functions delivered work fine (ex: ls, etc...) : R has been installed "at the root" of C:\ to avoid any blank in directory : names: C:\R\rw2000 : The PATH has been defined as environment variable in Windows XP as: : C:\Perl\Rtools;C:\Perl\bin;...;C:\R\rw2000\bin : : A trial package named "AnExample" has been prepared as indicated in the : example of package.skeleton() of the library "utils" and put in C:\ : : from there I have typewritten: : : C:\>RCMD build AnExample : : With this result: : : Can't open perl script "C:\R\rw2000/bin/build": No such file or directory : : I could catch that indeed 'build.exe' does not exist in this directory : (which is true...) and tried to find it somewhere on my c: disk. : Unfortunately, this 'build' or 'build.exe' file does not exist nor a : 'check' file, nor any complementary command of Rcmd : : After some research hours (actually since yesterday...), I cannot find : where I have got wrong yet... and considering the result, I am sure I got : somewhere! : : Can somebody help me on this? : There have been relevant discussions on r-devel just this weekend. Have a look at those archives http://news.gmane.org/gmane.comp.lang.r.devel and this post in particular: http://article.gmane.org/gmane.comp.lang.r.devel/1653
Prof Brian Ripley
2004-Nov-07 15:00 UTC
[R] writing a simple package in R 2.0 under Windows XP
On Sun, 7 Nov 2004, H Patrick Giraudoux wrote:> Dear listers, > > I have developped a set of functions that I would like to package on a > Windows XP plateform for some friends (this would be more simple than to > deliver them as a source text file without handy help). I am working under > Windows XP. > > Of course I have gone through the manual "Writing R extension" and try to > sort out what a most simple "packaging" for beginner (without compiled > code, etc...) could be. I also read > http://www.rap.ucar.edu/staff/ericg/RWinBuild.html It is very easy to build > R packages in Windows (for Windows)... > > Perl has been installed and works fine C:\Perl (source > http://www.activestate.com/Products/ActivePerl/Download.html). > R Tools have been installed: C:\Perl\Rtools (source: > http://www.murdoch-sutherland.com/Rtools/tools.zip) > R tools functions delivered work fine (ex: ls, etc...) > R has been installed "at the root" of C:\ to avoid any blank in directory > names: C:\R\rw2000 > The PATH has been defined as environment variable in Windows XP as: > C:\Perl\Rtools;C:\Perl\bin;...;C:\R\rw2000\bin > > A trial package named "AnExample" has been prepared as indicated in the > example of package.skeleton() of the library "utils" and put in C:\ > > from there I have typewritten: > > C:\>RCMD build AnExampleDid you want to package up the sources of a package you haven't tested? Surely you wanted to install and test it first?> With this result: > > Can't open perl script "C:\R\rw2000/bin/build": No such file or directoryA Perl script is not `build.exe': this really is just 'build'.> I could catch that indeed 'build.exe' does not exist in this directory > (which is true...) and tried to find it somewhere on my c: disk. > Unfortunately, this 'build' or 'build.exe' file does not exist nor a > 'check' file, nor any complementary command of Rcmd > > After some research hours (actually since yesterday...), I cannot find > where I have got wrong yet... and considering the result, I am sure I got > somewhere!You apparently DEselected the installation of the source package tools when you installed R. You need to go back and install them.> Can somebody help me on this? > > Thanks in advance, > > Patrick Giraudoux > > > [[alternative HTML version deleted]]You apparently missed the comment about HTML mail in the posting guide. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Dear Patrick, I've prepared some basic instructions and a batch file for building simple packages under Windows and have given them to several people who have experienced problems. I've hesitated to send them to this list since they really just duplicate information available elsewhere, and because the batch file probably could be improved. Since there has been a rash of Windows package-building problems recently (probably because it's no longer possible to bypass the package-building tools), I've appended the instructions and batch file to this message in the hope that they prove useful. Of course, comments and suggestions for improvement are appreciated. Regards, John -------------- snip ------------ Building Simple Packages Under R for Windows 1. Links to tools and additional information are at <http://www.murdoch-sutherland.com/Rtools/>. 2. Make sure R is *not* installed under c:\Program Files (or in any location with spaces in the path) and that it is installed with package-building tools. I use c:\R for the installation; I'll assume this below -- make changes as necessary. 3. Download <http://www.murdoch-sutherland.com/Rtools/tools.zip> and unzip e.g. to c:\Program Files\Utilities; put this directory at the beginning of the path. (It may be necessary to copy sh.exe to c:\bin\sh.exe.) 4. Download Perl from <http://www.activestate.com/Products/ActivePerl/Download.html> and install it using defaults. 5. Download fptex from <http://www.ctan.org/tex-archive/systems/win32/fptex/current/TeXSetup.exe> and install it. Note: This requires a fast internet connection during the installation. Don't install latex under c:\Program Files\! 6. Download HTML Help Workshop from <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/htmlhelp/h tml/hwmicrosofthtmlhelpdownloads.asp> and install it. Add c:\Program Files\HTML Help Workshop to the path. 7. If you want to be able to compile old-style Windows help files (probably not necessary) download Microsoft Help Workshop <ftp://ftp.microsoft.com/softlib/mslfiles/hcwsetup.exe> and install it. Add c:\Program Files\Help Workshop to the path. 8. Put my file make-package.bat in c:\R\rwxxxx\src (where xxxx is the version, e.g., 2000). If necessary, edit this file to reflect the location of the R installation. 9. Open a DOS (command) window. CD to R\rwxxxx\src. Make sure that the package source files are in the directory package-name under R\rwxxx\src\library. Enter make-package package-name. Carefully examine the log file etc. 10. After this process is completed, you'll have both a tar.gz file with the source package and a .zip file with the Windows binary package. Install the latter from the "Packages -> Install package(s) from local zip files" menu in the normal manner. -------------- make-package.bat ------------ cd c:\R\rw2000\src\library del %1\INDEX del %1\data\00Index del %1\chm\*.* /Q ..\..\bin\R CMD build --force --binary --auto-zip %1 ..\..\bin\R CMD build --force %1 ..\..\bin\R CMD check %1 cd %1.Rcheck dvipdfm %1-manual notepad 00check.log ---------------------------------------------> -----Original Message----- > From: r-help-bounces at stat.math.ethz.ch > [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of H > Patrick Giraudoux > Sent: Sunday, November 07, 2004 9:34 AM > To: r-help > Subject: [R] writing a simple package in R 2.0 under Windows XP > > Dear listers, > > I have developped a set of functions that I would like to > package on a Windows XP plateform for some friends (this > would be more simple than to deliver them as a source text > file without handy help). I am working under Windows XP. > > Of course I have gone through the manual "Writing R > extension" and try to sort out what a most simple "packaging" > for beginner (without compiled code, etc...) could be. I > also read http://www.rap.ucar.edu/staff/ericg/RWinBuild.html > It is very easy to build R packages in Windows (for Windows)... > > Perl has been installed and works fine C:\Perl (source > http://www.activestate.com/Products/ActivePerl/Download.html). > R Tools have been installed: C:\Perl\Rtools (source: > http://www.murdoch-sutherland.com/Rtools/tools.zip) > R tools functions delivered work fine (ex: ls, etc...) R has > been installed "at the root" of C:\ to avoid any blank in directory > names: C:\R\rw2000 > The PATH has been defined as environment variable in Windows XP as: > C:\Perl\Rtools;C:\Perl\bin;...;C:\R\rw2000\bin > > A trial package named "AnExample" has been prepared as > indicated in the example of package.skeleton() of the library > "utils" and put in C:\ > > from there I have typewritten: > > C:\>RCMD build AnExample > > With this result: > > Can't open perl script "C:\R\rw2000/bin/build": No such file > or directory > > I could catch that indeed 'build.exe' does not exist in this > directory (which is true...) and tried to find it somewhere > on my c: disk. > Unfortunately, this 'build' or 'build.exe' file does not > exist nor a 'check' file, nor any complementary command of Rcmd > > After some research hours (actually since yesterday...), I > cannot find where I have got wrong yet... and considering the > result, I am sure I got somewhere! > > Can somebody help me on this? > > Thanks in advance, > > Patrick Giraudoux > > > [[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
H Patrick Giraudoux
2004-Nov-07 19:58 UTC
[R] writing a simple package in R 2.0 under Windows XP
Dear all, Following John Fox and Brian Ripley instructions, things come better. I still get errors but they just come at the first step from unappropriate DESCRIPTION file (which was expected: I just wanted to check if the software installation was OK for building packages with the "crude" AnExample from the package.skeleton() doc. I can "quitely" come back to the "Writing R extension guide" and work on it now). One mishaps that can be worthy to bold for other listers is that I did not select the installation of the source package tools in an early installation of R (it is unselected by default with rw2000.exe). Advised to re-install R taking this into account for those who gradually try to move from function development to package writing... Thanks for the hints kindly provided even a Sunday, Patrick Giraudoux A 10:24 07/11/2004 -0500, vous avez ??crit :>Dear Patrick, > >I've prepared some basic instructions and a batch file for building simple >packages under Windows and have given them to several people who have >experienced problems. I've hesitated to send them to this list since they >really just duplicate information available elsewhere, and because the batch >file probably could be improved. > >Since there has been a rash of Windows package-building problems recently >(probably because it's no longer possible to bypass the package-building >tools), I've appended the instructions and batch file to this message in the >hope that they prove useful. Of course, comments and suggestions for >improvement are appreciated. > >Regards, > John > >-------------- snip ------------ > >Building Simple Packages Under R for Windows > >1. Links to tools and additional information are at ><http://www.murdoch-sutherland.com/Rtools/>. > >2. Make sure R is *not* installed under c:\Program Files (or in any location >with spaces in the path) and that it is installed with package-building >tools. I use c:\R for the installation; I'll assume this below -- make >changes as necessary. > >3. Download <http://www.murdoch-sutherland.com/Rtools/tools.zip> and unzip >e.g. to c:\Program Files\Utilities; put this directory at the beginning of >the path. (It may be necessary to copy sh.exe to c:\bin\sh.exe.) > >4. Download Perl from ><http://www.activestate.com/Products/ActivePerl/Download.html> and install >it using defaults. > >5. Download fptex from ><http://www.ctan.org/tex-archive/systems/win32/fptex/current/TeXSetup.exe> >and install it. Note: This requires a fast internet connection during the >installation. Don't install latex under c:\Program Files\! > >6. Download HTML Help Workshop from ><http://msdn.microsoft.com/library/default.asp?url=/library/en-us/htmlhelp/h >tml/hwmicrosofthtmlhelpdownloads.asp> and install it. Add c:\Program >Files\HTML Help Workshop to the path. > >7. If you want to be able to compile old-style Windows help files (probably >not necessary) download Microsoft Help Workshop ><ftp://ftp.microsoft.com/softlib/mslfiles/hcwsetup.exe> and install it. Add >c:\Program Files\Help Workshop to the path. > >8. Put my file make-package.bat in c:\R\rwxxxx\src (where xxxx is the >version, e.g., 2000). If necessary, edit this file to reflect the location >of the R installation. > >9. Open a DOS (command) window. CD to R\rwxxxx\src. Make sure that the >package source files are in the directory package-name under >R\rwxxx\src\library. Enter make-package package-name. Carefully examine the >log file etc. > >10. After this process is completed, you'll have both a tar.gz file with the >source package and a .zip file with the Windows binary package. Install the >latter from the "Packages -> Install package(s) from local zip files" menu >in the normal manner. > >-------------- make-package.bat ------------ > >cd c:\R\rw2000\src\library >del %1\INDEX >del %1\data\00Index >del %1\chm\*.* /Q > >..\..\bin\R CMD build --force --binary --auto-zip %1 >..\..\bin\R CMD build --force %1 >..\..\bin\R CMD check %1 > >cd %1.Rcheck >dvipdfm %1-manual > >notepad 00check.log