From edd @end|ng |rom deb|@n@org  Fri Feb  1 22:53:58 2019
From: edd @end|ng |rom deb|@n@org (Dirk Eddelbuettel)
Date: Fri, 1 Feb 2019 15:53:58 -0600
Subject: [Rd] Runnable R packages
In-Reply-To: <CAF8bMcZvsdq5D8w5W7=kfuuZHbKiP4B3EgeOE5M-DKCNRJE-=g@mail.gmail.com>
References: <CAKtMxAFYFafUHOitKEUbRSPxXVgHd+sWe_937YHNHJOyNEm_3g@mail.gmail.com>
 <CAKtMxAHmoT=L211CJbyB034bY0ddyY8jg_QqB+LgWZCm_XgL3Q@mail.gmail.com>
 <CAPvvxJX_EFOE26vU4zBH_T2LuP7tRgV_CJx4LsvP6eN8PLZNLQ@mail.gmail.com>
 <CALEXWq2mJ=r7t4Z2akQGe1vDhu9RdHikYCGqdZy_xS1nx=YMnw@mail.gmail.com>
 <72b511b92df64f69ab43f2ce5c654584@LNXP265MB1705.GBRP265.PROD.OUTLOOK.COM>
 <CANVKczOZcSz0YLuKiWfdU0x3qMP0GvUAdqDgp32rmrPfHmK1tA@mail.gmail.com>
 <CAKtMxAHuV1dioQbty8SHpgg15qvHfAheCNN+7qZ1JFuricAjJA@mail.gmail.com>
 <CAF8bMcZvsdq5D8w5W7=kfuuZHbKiP4B3EgeOE5M-DKCNRJE-=g@mail.gmail.com>
Message-ID: <23636.49142.456368.124053@rob.eddelbuettel.com>


On 1 February 2019 at 13:31, William Dunlap via R-devel wrote:
| To download a package with all its dependencies and install it, use the
| install.packages() functions instead of 'R CMD INSTALL'.  E.g., in bash:
| 
| mkdir /tmp/libJunk
| env R_LIBS_SITE=libJunk R --quiet -e 'if
| (!requireNamespace("purrr",quietly=TRUE)) install.packages("purrr")'

Or one could use 'littler' and install some of its examples in the $PATH path
(which I tend to do via softlinks to get updates easily).

Then it is simply

   $ install.r purrr

and there is also install2.r with docopt goodness and more options.

These have been my preferred tools for many years at home and work, and they
found their way through Rocker dockerfiles as well as install2.r was started
by Carl for added features.
 
| For corporate "production use" you probably want to set up your own
| repository containing
| fixed versions of packages instead of using CRAN.  Then edd repos="..." to
| the install.packages()
| call.  Of course you can put this into a package and somehow deal with the
| bootstrapping issue.

Absolutely. But what repo to source packages from is somewhat orthogonal to
how to install from there. Also, thanks to Gergely, repos is now an argument
to install2.r

Dirk

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



[Rd] Runnable R packages
Dirk Eddelbuettel