[R-pkg-devel] Running a script after a package has been installed.

Dirk Eddelbuettel edd at debian.org
Wed Jun 3 14:13:19 CEST 2015

On 3 June 2015 at 12:51, Luca Cerone wrote:
| Dear all,
| I am writing a package that contains some binaries that should be
| linked in /usr/bin after the package

[ Don't do that, /usr is for your system. Use /usr/local/bin. ]

| has been installed (I placed them in Rpackage/inst/bin)
| I know I can use a script "configure" or "configure.win" to be run
| before the package has been installed, is there a way I can write a
| script that is run after the package has been correctly installed?

You can't. I miss that too.

We do the same thing at work -- scripts (often via Rscript or littler) go
into into/scripts inside a package, we then have to (at least _one time_)
create a softlink from /usr/local/bin into (on our systems with Debian/Ubuntu
paths) /usr/local/lib/R/site-library/PKG/script/SCRIPT where PKG and SCRIPT

Having more 'hooks' in the R CMD INSTALL ... process would be nice, but it
doesn't exist now.

One alternative is to package the R package as a .deb package to use the
proper postinst.  But that may be overkill / does not help on other OS.


http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org

More information about the R-package-devel mailing list