Hello, My question is the following. Has anyone put together an "idiots" checklist of the steps needed to build a (small personal) package under Windows, or documented their own experiences of building packages under Windows? I ask this as last week there were some very interesting comments regarding the advantages of putting personally written functions together as a package rather than sourcing them in at the start of a session using .Rprofile. They inspired me to try to build my own package for a few functions I use in teaching on my laptop running Windows XP . I read and reread "Writing R extensions" I installed Pearl and tried build on a modified package.skeleton. I fairly quickly worked out I needed to do things like setting Tmpdir as an environment variable, but then I got stuck and frustrated and gave up. I'm sure that with more time I would get things working, but I don't have more time. Could the process be made smoother through better documentation? This may sound like laziness, but I do guess that there are others are in the same position who find that the initiial hassles of building a package (under Windows) leads to a negative cost benefit balance over less elegant solutions. Thanks, Duncan Golicher -- Dr Duncan Golicher Ecologia y Sistematica Terrestre Conservaci?n de la Biodiversidad El Colegio de la Frontera Sur San Cristobal de Las Casas, Chiapas, Mexico Tel. 967 1883 ext 1310 Celular 044 9671041021 dgoliche at sclc.ecosur.mx
I presume you got this error message: Error: environment variable Tmpdir not set (or set to unusable value) and not default available. at ...\perl/R/Utils.pm line 67 The simplest thing to do is to create a folder named "Temp" in your C drive. I hope it helps. Best, Dimitris ---- Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/16/336899 Fax: +32/16/337015 Web: http://www.med.kuleuven.ac.be/biostat/ http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm ----- Original Message ----- From: "Duncan Golicher" <dgoliche at sclc.ecosur.mx> To: <r-help at stat.math.ethz.ch> Sent: Monday, April 11, 2005 8:58 AM Subject: [R] Building R packages under Windows.> Hello, > > My question is the following. Has anyone put together an "idiots" > checklist of the steps needed to build a (small personal) package > under Windows, or documented their own experiences of building > packages under Windows? > > I ask this as last week there were some very interesting comments > regarding the advantages of putting personally written functions > together as a package rather than sourcing them in at the start of a > session using .Rprofile. They inspired me to try to build my own > package for a few functions I use in teaching on my laptop running > Windows XP . I read and reread "Writing R extensions" I installed > Pearl and tried build on a modified package.skeleton. I fairly > quickly worked out I needed to do things like setting Tmpdir as an > environment variable, but then I got stuck and frustrated and gave > up. I'm sure that with more time I would get things working, but I > don't have more time. Could the process be made smoother through > better documentation? This may sound like laziness, but I do guess > that there are others are in the same position who find that the > initiial hassles of building a package (under Windows) leads to a > negative cost benefit balance over less elegant solutions. > > Thanks, > > Duncan Golicher > > -- > Dr Duncan Golicher > Ecologia y Sistematica Terrestre > Conservaci?n de la Biodiversidad > El Colegio de la Frontera Sur > San Cristobal de Las Casas, Chiapas, Mexico > Tel. 967 1883 ext 1310 > Celular 044 9671041021 > dgoliche at sclc.ecosur.mx > > ______________________________________________ > 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 >
Duncan Golicher wrote:> Hello, > > My question is the following. Has anyone put together an "idiots" > checklist of the steps needed to build a (small personal) package under > Windows, or documented their own experiences of building packages under > Windows? > > I ask this as last week there were some very interesting comments > regarding the advantages of putting personally written functions > together as a package rather than sourcing them in at the start of a > session using .Rprofile. They inspired me to try to build my own package > for a few functions I use in teaching on my laptop running Windows XP . > I read and reread "Writing R extensions" I installed Pearl and tried > build on a modified package.skeleton. I fairly quickly worked out I > needed to do things like setting Tmpdir as an environment variable, but > then I got stuck and frustrated and gave up. I'm sure that with more > time I would get things working, but I don't have more time. Could the > process be made smoother through better documentation? This may sound > like laziness, but I do guess that there are others are in the same > position who find that the initiial hassles of building a package (under > Windows) leads to a negative cost benefit balance over less elegant > solutions.The docs are already very condensed for this topic and you need to read each line (sometimes each word!). Do you want more text to read through that contains the same information? Telling us what your problem is would be much better. I do not know what is missing in the docs - it's just working for me. Uwe Ligges> Thanks, > > Duncan Golicher >
Duncan Golicher wrote:> Hello, > > My question is the following. Has anyone put together an "idiots" > checklist of the steps needed to build a (small personal) package > under Windows, or documented their own experiences of building > packages under Windows? > > I ask this as last week there were some very interesting comments > regarding the advantages of putting personally written functions > together as a package rather than sourcing them in at the start of a > session using .Rprofile. They inspired me to try to build my own > package for a few functions I use in teaching on my laptop running > Windows XP . I read and reread "Writing R extensions" I installed > Pearl and tried build on a modified package.skeleton. I fairly quickly > worked out I needed to do things like setting Tmpdir as an environment > variable, but then I got stuck and frustrated and gave up. I'm sure > that with more time I would get things working, but I don't have more > time. Could the process be made smoother through better documentation? > This may sound like laziness, but I do guess that there are others are > in the same position who find that the initiial hassles of building a > package (under Windows) leads to a negative cost benefit balance over > less elegant solutions.In versions up to 2.0.1, the description is a little spread out, but the main file you want to look at is readme.packages. I have tried to collect all the information into one place in the 2.1.0 release (and put it in the R Admin manual). As far as I recall there are no important differences between the instructions, so if you download the beta version of that manual and try those instructions, I would be very happy to hear from you about anything that is unclear or incorrect. You can get the Windows beta build from <http://cran.r-project.org/bin/windows/base/rdevel.html>. I do not think the beta manuals are online anywhere separate from the full release. Duncan Murdoch
On Apr 11, 2005 2:58 AM, Duncan Golicher <dgoliche at sclc.ecosur.mx> wrote:> Hello, > > My question is the following. Has anyone put together an "idiots" > checklist of the steps needed to build a (small personal) package under > Windows, or documented their own experiences of building packages under > Windows? > > I ask this as last week there were some very interesting comments > regarding the advantages of putting personally written functions > together as a package rather than sourcing them in at the start of a > session using .Rprofile. They inspired me to try to build my own package > for a few functions I use in teaching on my laptop running Windows XP . > I read and reread "Writing R extensions" I installed Pearl and tried > build on a modified package.skeleton. I fairly quickly worked out I > needed to do things like setting Tmpdir as an environment variable, but > then I got stuck and frustrated and gave up. I'm sure that with more > time I would get things working, but I don't have more time. Could the > process be made smoother through better documentation? This may sound > like laziness, but I do guess that there are others are in the same > position who find that the initiial hassles of building a package (under > Windows) leads to a negative cost benefit balance over less elegant > solutions. > > Thanks,Other resources are: - http://www.murdoch-sutherland.com/Rtools/ - README.packages in \Program Files\R\rw2001 or whatever version of R - posts by me, John Fox, Andy Liao in r-help or r-devel I use Windows XP and it also took me quite a bit of time until I figured it out too. I was really wondering as I got frustrated how it was possible that 500+ packages got developed for R when it was so hard to figure out how to create a package, particularly if you want to put in a vignette. One of the problems is that its dependent on so many other pieces of software and also there can be path problems that you have to figure out. I suspect that the process is somewhat smoother under UNIX and maybe most people use that. Fortunately, it does all work once you get it figured out and its worth it if you are going to do a lot of development since it really helps organize you. If you are just going to use it briefly or casually its probably not worth the hassle. Once you do figure it out it does work although there are a few annoyances. R CMD CHECK is really great although I wish there were some way of telling it to ignore the files referenced in .Rbuildignore so one does not have to do a build first. Also the error messages from the process are often less than helpful but I suspect it would be difficult to improve since it can go wrong at a point which is different than the source of the problem. I think the fixable problems are: - a guide is needed, as you mention - the prerequisites need to be reduced: -- significant portions are written in perl which is probably a holdover from the days when R was less powerful and now could all be ported to R -- it would be nice it the tools were not needed either. -- reduced functionality with no Microsoft style help should be possible to optionally allow one to create packages without downloading the Microsoft help compiler - the TEXINPUTS problems with MiKTeX needs to be solved by MiKTeX (they know about it and intend to solve it but I am not sure how quickly that will happen. In the meantime there are workarounds at: http://www.murdoch-sutherland.com/Rtools/miktex.html The fourth alternative is the easiest. I think this only affects you if you are building vignettes.)
Many, many thanks to Renaud Lancelot who sent me exactly the sort of guide I was looking for. It is in French, but exceptionally clear and easy to follow and I got a rough and ready test package built in no time. It really is not that hard if you don't bother with TeX/LaTeX. Most of my previous hassles seemed to have arisen from path problems. Even so it would be nice to see the process streamlined a bit more in the future. Thanks again to everyone, Duncan Golicher -- Dr Duncan Golicher Ecologia y Sistematica Terrestre Conservaci?n de la Biodiversidad El Colegio de la Frontera Sur San Cristobal de Las Casas, Chiapas, Mexico Tel. 967 1883 ext 1310 Celular 044 9671041021 dgoliche at sclc.ecosur.mx
Hello, I feel a brief follow up to my post a few days ago is in order. Thanks to Renaud Lancelot's truly excelent step by step guide I solved my own difficulties in building R packages for personal use. A short while after he sent me his document the reply was -"Voil?! Je l'ai fonctionnant (enfin!). C'est facile!" My French is obviously quite hopeless which is a tribute to the clarity of his explanation! However I am still receiving a suprising number of off list comments to the effect that package building is much more trouble than it is worth. I'm now convinced that it's not, thanks to Renaud's very clear document. The problem seems to lie in the fact that the "official" documentation for package construction is aimed at those providing serious "R extensions" for publication on CRAN. That's fine, but packages are also very useful for personal use as a neat way of keeping your own stuff organised and documented. At the moment the overhead (time) for personal package construction superficially looks much higher than it need be, especially for users of R under Windows. Dare I say it, but all the saintly souls who dedicate their lives to R sometimes overlook lay users who have a(nother) life! Is anyone working on a simple way of building packages, or explaining how to build packages? They would find a larger user base than they might suspect. Duncan Golicher -- Dr Duncan Golicher Ecologia y Sistematica Terrestre Conservaci?n de la Biodiversidad El Colegio de la Frontera Sur San Cristobal de Las Casas, Chiapas, Mexico Tel. 967 1883 ext 1310 Celular 044 9671041021 dgoliche at sclc.ecosur.mx
Prof Ripley has quite rightly pointed out that my previous comment could be (quite wrongly) interpreted as denigrating the work of the R team. This was far from my intention. I apologise to all concerned for a terribly flippant remark that was certainly not meant as a criticism of anyone. It came out wrong. Like all other R users I am deeply indebted to the work of the R core team and marvel at the selflessness and generosity of all concerned. All I meant to say was that user base of R has expanded enormously since the excellent documentation was written and it is only natural that some elements do not reflect this. The fact that package building turns out to be much easier than it looks to be when you first read "Writing R extensions" is a complement to the tremendous work of R developers, not a denigration. Deepest apologies again to all for my clumsiness, Duncan Golicher Duncan Golicher -- Dr Duncan Golicher Ecologia y Sistematica Terrestre Conservaci?n de la Biodiversidad El Colegio de la Frontera Sur San Cristobal de Las Casas, Chiapas, Mexico Tel. 967 1883 ext 1310 Celular 044 9671041021 dgoliche at sclc.ecosur.mx