panda
panda

Reputation: 871

R: Check which branch of a package was installed with install_git

Say I use the function install_git from library devtools to install a particular branch of a package e.g. from the install_git documentation:

install_git("git://github.com/hadley/stringr.git", branch = "stringr-0.2")

Is there a way later on to find out if a branch was installed and if so which one? I can use packageVersion() to find the version of the package installed, but this does not give me any additional information about branches referenced.

Upvotes: 1

Views: 686

Answers (1)

panda
panda

Reputation: 871

I have found the answer - the information is contained in the output of the function packageDescription('package_name') e.g.

 packageDescription('mlr') 

The output is fairly verbose, but the following items within that output hold the answer:

RemoteRepo: mlr
RemoteRef: mindepth_order
GithubRepo: mlr
GithubRef: mindepth_order

This shows that package mlr is loaded, referencing the branch mindepth_order.

Upvotes: 3

Related Questions