niszetの日記

細かい情報を載せていくブログ

(R) remotesパッケージ(メモ)

最近、他のパッケージのインストール方法として見ることが多くなった気がしませんか?

そうでもないですかね?

CRANにもある

CRAN - Package remotes

GitHub版はこちら。 github.com

説明には

Download and install R packages stored in GitHub, BitBucket, or plain subversion or git repositories. This package is a lightweight replacement of the install_* functions in devtools. Indeed most of the code was copied over from devtools.

とあるように、devtoolsパッケージから切り出した形のようです(が、devtoolsの方がなくなったわけではない)

ちょっと確かめてみると、

identical(remotes::install_github, devtools::install_github)
#> [1] FALSE

となります。あれ…?

先日のdiffobjパッケージを使って比較してみましょうか。

ibrary(remotes)
diffobj::diffObj(remotes::install_github, devtools::install_github)

結果は

f:id:niszet:20180728205333p:plain となり、微妙に差異がありますね。

devtoolsの方からなくなることはないとは思いますが(remotesの方に全て機能を移し替えたらwrapperとして動く可能性はある)、単にリポジトリからインストールするだけの目的であればremotesパッケージだけ入れる、というのもありかもしれませんね(devtoolsパッケージはそれなりに重いので)

Enjoy!!