简体   繁体   中英

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 eg 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.

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

 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM