Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a function to check if a package installed with devtools::install_github has been updated?

Tags:

r

devtools

I am the author of a package storred on github. My colleagues install this package with devtools::install_github(). They would like to test if the package has been updated or not. Is there a function to check that there has been a commit to the github master branch since they last installed the package?

like image 571
Paul Rougieux Avatar asked Dec 17 '15 08:12

Paul Rougieux


People also ask

What are the functions in Devtools package?

The devtools package contains functions that help with R package development. These functions include create , which creates the initial structure for a new package, as well as a number of functions for adding useful infrastructure to the package directory and functions to load and document the package.

How long does it take to install Devtools in R?

In my case, it takes about 20 minutes. Fortunately, the devtools::check_win_release() and devtools::build() commands are quick in a few seconds. However, I recently link the package to my GitHub repository for the version control.


1 Answers

This is an indirect approach I am aware of You can then find your installed version by packageVersion()

There's a package available which goes by the name versions. The function available.versions() could help you. This will find you all the package versions ever available.

packageVersion("ggplot2")
#[1] ‘1.0.1’

available.versions("ggplot2")

#$ggplot2
#   version       date available
#1    1.0.1 2015-03-17      TRUE
#2    1.0.0 2014-05-21     FALSE
#3  0.9.3.1 2013-03-02     FALSE
...

Update:

Package devtools has functions package_deps() and dev_package_deps().

package_deps("ggplot2")

# Needs update -----------------------------
# package      installed available
# ggplot2      2.0.0     2.1.0    
# scales       NA        0.4.0   

?package_deps
"Find all dependencies of a CRAN or dev package."

{This function is untested for development package from my end . However I believe this should do your job.}

like image 135
GAURAV Avatar answered Sep 30 '22 19:09

GAURAV