Writeup: internal-package distribution



This is an extension of a thread started in the #package-development forum. Thanks to some kind feedback, I was encouraged to make a post in here in #r-admin on an article I had written on internal-package distribution.

The problem being addressed is how to build and maintain a CRAN-like repository for private packages within an "internal" environment, like a company or an institution. You want the convenience and robustness of install.packages(), but you cannot share the package beyond your institution.

tl;dr version: the method I propose uses the drat package with an instance of GitHub Enterprise.

The longer version is addressed by a package I am working on, called ghentr, to help you use some of devtools' GitHub "magic" with your instance of GitHub Enterprise.

If you are still interested in learning more, there's also a presentation you can watch from #rstudio-conf (2018).


To add experience on this subect, I can share what I have done so fare as we don't have Github Entreprise.

For internal package, I use a internal repository using the help of drat and packrat to create the repository. The repository is either in a file system (you can a have a filesystem repository) or in a webserver. One of the solution was to have internal repository endpoint on our cran mirror. Example:

Other solutions I try and currently experience are related to product my company have.

  • We have a gitlab so I am thinking of a ghentr cousin for gitlab, but all functions are not possible as gitlab page are not by default.
  • we also have a nexus repository for all other language repo (java, python, c++, ...) so why not use it for R. I am trying that to.

About this subject, know that there is also another discussion in the community


Just a couple reactions to @cderv's points: the conversation I had with him on this was one of my highlights of RStudio Conf; I'm really excited to see what follows from his gitlab work. As well, I too am very interested in finding a way forward on Nexus.

I'm embarrassed that, in my rush, I didn't fully realize @sellorm's thread was already in this forum - sorry about that! Is there any magic that can be used to remove this thread and append it to that one?


None that we've discovered – the best way we've found thus far is just to link to the other (as you did), which does show up at the bottom of the other thread. (Kind of like with GitHub issues and pull requests).


Thanks @mara!

In that case, in addition to apologizing to all concerned, I'd like to suggest that this be the last post in this thread, and that any discussion be continued over in the original thread.


I know you should have been last, but just to add something : I think an admin (@EconomiCurtis ?) can lock a thread. It could be the solution to keep only one thread by locking this one.