24
votes

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?

3
My dtupdate package helps with that. - hrbrmstr
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
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
@hrbrmstr Can you make that an answer? - Thomas
you can also add a github repository as drat-repository via the drat package from Dirk Eddelbuettel. After that you can use update.packages() on it - jeborsel

3 Answers

4
votes

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

0
votes

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

0
votes

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)