[Rd] Runnable R packages
Dirk Eddelbuettel
edd @end|ng |rom deb|@n@org
Fri Feb 1 22:53:58 CET 2019
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 using debian.org
More information about the R-devel
mailing list