A new package of mine just got to CRAN in its very first version 0.0.1: drat. Its name stands for drat R Archive Template, and an introduction is provided at the drat page, the GitHub repository, and below.
drat builds on a core strength of R: the ability to query multiple repositories. Just how one could always query, say, CRAN, BioConductor and OmegaHat—one can now adds drats of one or more other developers with ease. drat also builds on a core strength of GitHub. Every user automagically has a corresponding
github.io address, and by appending
drat we are getting a standardized URL.
to register my drat. Now
install.packages() will work using this new drat, as will
update.packages(). The fact that the update mechanism works is a key strength: not only can you get a package, but you can gets its updates once its author replaces them into his drat.
How does one do that? Easy! For a package
foo_0.1.0.tar.gz we do
The default git repository locally is taken as the default
~/git/drat/ but can be overriden as both a local default (via
options()) or directly on the command-line. Note that this also assumes that you a) have a
gh-pages branch and b) have that branch as the currently active branch. Automating this / testing for this is left for a subsequent release. Also available is an alternative unexported short-hand function:
show here with the alternate use case of a local fileshare you can copy into and query from—something we do at work where we share packages only locally.
The easiest way to obtain the corresponding file system layout may be to just fork the drat repository.
So that is it. Two exported functions, and two unexported (potentially name-clobbering) shorthands. Now drat away!