[R] building a "simple" R package

Charles Annis, P.E. Charles.Annis at StatisticalEngineering.com
Sun May 2 18:36:57 CEST 2004


My thanks to Jason Turner and Professor Ripley for alerting me to the
difficulties of spaces-in-filepaths.   

To possible readers of the archives the "short form" the Professor suggested
is e.g.: C:\PROGRA~1\R\rw1081\bin, substituting the tilde for the offending
space-containing filepath and constructing an 8-character name.

This indeed has allowed me to build the tar file as is corroborated by the
screendump:
##########  Screen Dump    #########################################
C:\PROGRA~1\R\rw1081\bin>Rcmd build myPOD
* checking for file 'myPOD/DESCRIPTION' ... OK
* preparing 'myPOD':
* checking whether 'INDEX' is up-to-date ... OK
* removing junk files
* building 'myPOD_1.0.tar.gz'

C:\PROGRA~1\R\rw1081\bin>
##########  End Screen Dump    #####################################

I would like to report that I was subsequently able to install this
successfully, but, alas, I am not out of the woods yet - but at least now I
have a compass, and for this I am indebted to Jason Turner and Professor
Ripley.

Thank you.


Charles Annis, P.E.
 
Charles.Annis at StatisticalEngineering.com
phone: 561-352-9699
eFax:  503-217-5849
http://www.StatisticalEngineering.com

-----Original Message-----
From: Prof Brian Ripley [mailto:ripley at stats.ox.ac.uk] 
Sent: Sunday, May 02, 2004 2:51 AM
To: Charles Annis, P.E.
Cc: R-help at stat.math.ethz.ch
Subject: Re: [R] building a "simple" R package

Did you read the bits in README.packages which say

  Do not use filepaths with spaces in: you can always use the short forms
  ...

  BEWARE: Don't expect this to work if the path to R_HOME contains spaces.
  It may work, but we don't recommend it.

?  You also appear to be trying to build your package in a filepath with 
spaces in.  So try putting your source files somewhere without spaces in 
the file name.

Or try updating to R 1.9.0, as its CHANGES files says

  R CMD INSTALL/build/check map path names with spaces in to their short
  forms.

so it should work in the current version of R.


On Sat, 1 May 2004, Charles Annis, P.E. wrote:

> Dear R-ers:
> 
> Recognizing that it is better to remain silent and have people think you
> stupid than to speak and remove any doubt, I fear that I must speak
> nonetheless.

A third possibility is to read the READMEs and FAQs.

> I am having the Devil's own time trying to make a simple R package for my
> own use.  Yes, I have perused the FAQs and searched the archives.  Yes, I
> have read "Writing R Extensions" and eventually divined what Rcmd means
and
> that it isn’t accessed from an R session.  I downloaded and installed
Perl,
> and eventually some Unix tools from
> http://www.murdoch-sutherland.com/Rtools/tools.zip, specifically tar.exe,
> sh.exe, cygwin1.dll, gzip.exe.  I found "package.skeleton" and was able to
> produce the requisite files, and even got "Rcmd build" to progress far
> enough to begin packaging things.  Alas, I am stymied.  As can be seen in
> the screen-dump below, after declaring that tar was building, it was
unable
> to proceed.
> 
> I am using R1.8.1 on a WinXP Professional DELL 3 GHz Pentium 4 with 2 Gig
> RAM.  I put all the files mentioned above, including my source folder (I
> only have R routines - no C or FORTRAN) in C:\Program Files\R\rw1081\bin
to
> avoid any potential PATH problems.
> 
> Can any kind reader help me?  I realize this shouldn't be this
complicated,
> but somehow I have made it thus, and would welcome a helping hand.
> 
> Thank you.
> 
> Charles Annis, P.E.
> 
> ##########  Screen Dump    #########################################
> 
> C:\Program Files\R\rw1081\bin>Rcmd build myPOD
> * checking for file 'myPOD/DESCRIPTION' ... OK
> * preparing 'myPOD':
> * checking whether 'INDEX' is up-to-date ... OK
> * removing junk files
> * building 'myPOD_1.0.tar.gz'
> tar: Files/R/rw1081/bin/myPOD_1.0.tar: Cannot stat: No such file or
> directory
> tar: Error exit delayed from previous errors
> tar: Files/R/rw1081/bin/myPOD_1.0.tar: Not found in archive
> tar: Error exit delayed from previous errors
> tar: Files/R/rw1081/bin/myPOD_1.0.tar: Cannot stat: No such file or
> directory
> tar: myPOD: Cannot stat: No such file or directory
> tar: Error exit delayed from previous errors
> myPOD_1.0.tar: No such file or directory
> 
> Charles Annis, P.E.
>  
> Charles.Annis at StatisticalEngineering.com
> phone: 561-352-9699
> eFax:  503-217-5849
> http://www.StatisticalEngineering.com
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html
> 
> 

-- 
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




More information about the R-help mailing list