26

I'm using more and more dev packages installed from github.

I find myself wondering if there is an easy way to update these packages? Essentially looking for something like update.packages() equivalent for install_github() (or indeed any other repo than CRAN).

Similar question for R-forge has some ideas:

Automatically update packages installed from R-forge

Maybe the best way to do this would be to install dev packages in their own separate directory:

How to specify lib directory when installing development version R Packages from github repository

keep a tab on packages as they are installed, and try re-installing list regularly.

Any thoughts?

Community
  • 1
  • 1
carnust
  • 611
  • 1
  • 8
  • 10
  • 12
    My [dtupdate](https://github.com/hrbrmstr/dtupdate) package helps with that. – hrbrmstr Jan 14 '15 at 12:04
  • In general, this is difficult because `CRAN` is a single repository, while `github` is a trillion separate repositories. That's why you need stuff like what @hrbrmstr refers to. As to what happens if a `github` package has `CRAN` dependencies, I dunno :-) – Carl Witthoft Jan 14 '15 at 12:49
  • Ok, that package does the trick nicely! I particularly like the ```whats_new()``` functionality to look over whether updating is a worthwhile risk? I presume that because packages are simply re-installed via ```github_install()```, ```CRAN``` and indeed other dependencies are taken care of? – carnust Jan 15 '15 at 13:03
  • 4
    @hrbrmstr Can you make that an answer? – Thomas Mar 10 '15 at 11:59
  • 3
    you can also add a github repository as drat-repository via the [drat package](http://dirk.eddelbuettel.com/code/drat.html) from Dirk Eddelbuettel. After that you can use update.packages() on it – jeborsel Mar 29 '15 at 19:25
  • I usually use git bash to update the package with all the latest commits. You can find a list of useful git bash commands at https://services.github.com/on-demand/downloads/github-git-cheat-sheet.pdf – Raj Padmanabhan Jul 19 '17 at 14:53

3 Answers3

6

There are a number of packages that will do this:

@hrbrmstr recommends the dtupdate package

@jeborsel suggests adding a github repository as drat-repository via the drat package from Dirk Eddelbuettel. This will let you use update.packages() on it

divibisan
  • 11,659
  • 11
  • 40
  • 58
0

You could use the pacman package to install and load the current version of a package hosted on GitHub:

pkg = c('andschar/dbreport', 'Rdatatable/data.table')
pacman::p_load_current_gh(char = pkg)
andschar
  • 3,504
  • 2
  • 27
  • 35
-1

You can call install_github again to get the most recent version of the package.

karirogg
  • 128
  • 8