[R-sig-Debian] R-scripts as executables for debian

Dirk Eddelbuettel edd at debian.org
Thu Jan 19 15:55:21 CET 2012


Michel,

On 19 January 2012 at 15:39, Michel Kuhlmann wrote:
| I'm looking for a way to make executable R-scripts -- which are bound to
| a certain package -- available to the operating system's search path.
| The executable R-scripts I put in the package's 'exec' directory. 

Unless I misunderstand, that will always be outside of the system $PATH though.
 
| Different solutions have come to my mind: 
|     o 'configure'-script copies the files to /usr/local/bin
|     o make a 'require'-shell function which adds 
|       '/usr/local/lib/R/site-library/<pkg>/exec' dynamically to $PATH
|     o generate a debian-package which contains separately the
|       executables. 

For executable R scripts, I suggest you do 'sudo apt-get install littler' and
write scripts for #!/usr/bin/r -- and see the different examples included in
the package.

My personal convention is to just end thos in a lowercase .r and to 'chmod
755' them, I have a few in ~/bin and /usr/local/bin/.

The R packaging system makes it hard to distribute this via packaging as
everything is effectively /outside/ the system patch.  We work around this
using r as well Rscript with things like "Rscript -e 'Rcpp:::LdFlags()'"
which we need to call from other packages.

Other packages have the same problem (when trying to ship executables based
on their code), and there is no solution I can see.  For a more general
discussion, r-devel may be better anyway.

Hope this helps,  Dirk

-- 
"Outside of a dog, a book is a man's best friend. Inside of a dog, it is too
dark to read." -- Groucho Marx



More information about the R-SIG-Debian mailing list