Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why use `devtools::install_github` instead of `remotes::install_github`?

Tags:

r

devtools

The recommendations in "R Packages (2e)" by Hadley Wickham and Jennifer Bryan leave you with the following installation recommendation in your README file:

# install.packages("devtools")
devtools::install_github("jennybc/regexcite")

However, I frequently use remotes::install_github instead since the remotes library is much easier to install. I've often been unable install devtools at all and when it does install it takes a significant amount of time to do so. In contrast, I've never had a failure installing remotes and it installs very quickly. This matters more for running R code on clusters, servers, and Docker images and not standard R Studio setups. I know that the functionality is identical since it originates from remotes either way and in other situations "R Packages" encourages using the minimal dependencies possible. Therefore I want to suggest remotes instead in my README.

Is there any reason not to recommend remotes over devtools? The only thing I can think of is that users are more likely to recognize the devtools name and know if they have it installed already.

like image 290
tgbrooks Avatar asked Oct 24 '25 16:10

tgbrooks


1 Answers

If that recommendation is still in print, it would seems outdated. These days, using remotes::install_github() is preferable, and has been since that package got split off.

One reason is that it has a much smaller installation footprint:

> db <- tools::CRAN_package_db()
> deps <- tools::package_dependencies(c("devtools", "remotes"), recursive=TRUE, db=db)
> sapply(deps, length)
devtools  remotes 
     101        4 
> 

(This count is still biased upwards, the four for remote are all base R packages.)

So in sum, you adopted the right pattern and can stick with it.

like image 122
Dirk Eddelbuettel Avatar answered Oct 27 '25 06:10

Dirk Eddelbuettel