One of my take aways from last week’s EARL conference was that R is more and more growing out of its academic roots into the enterprise. And with that come some challenges, e.g. how do I ensure consistent and systematic access to a set of R packages in an organisation, in particular when one team is providing packages to others?
I wrote about roxyPackage earlier on this blog. It allows me to create a local repository to distribute my package, while at the same time execute and control the build process from within R. But what about my package’s dependencies? Here miniCRAN helps. miniCRAN is a new package by Andrie de Vries that enables me to find and download all package dependencies and store them in a local repository, e.g. the one used by roxyPackage.
To create a local sub-CRAN repository for the two packages I maintain on CRAN and with all their dependencies I use:
library("miniCRAN")<br />my.pkgs <- c("googleVis", "ChainLadder")<br />pkgs <- pkgDep(my.pkgs, suggests = TRUE, enhances=FALSE)<br />makeRepo(pkgs = pkgs, path="/Users/Shared/myCRANRepos")And to visualise the dependencies:
dg <- makeDepGraph(my.pkgs, includeBasePkgs=FALSE, <br /> suggests=TRUE, enhances=TRUE)<br />set.seed(1)<br />plot(dg, legendPosEdge = c(-1, 1), <br /> legendPosVertex = c(1, 1), vertex.size=20)
Don’t miss out on Pat Burns’s insightful talk about effective risk management from EARL. His thoughts reminded me of the great Karl Popper: Good tests kill flawed theories; we remain alive to guess again.
R version 3.1.1 (2014-07-10)<br />Platform: x86_64-apple-darwin13.1.0 (64-bit)<br /><br />locale:<br /> en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8<br /><br />attached base packages:<br /> stats graphics grDevices utils datasets methods <br /> base <br /><br />other attached packages:<br /> miniCRAN_0.1-0<br /><br />loaded via a namespace (and not attached):<br /> httr_0.5 igraph_0.7.1 stringr_0.6.2 tools_3.1.1 <br /> XML_3.98-1.1