remotes::install_github should offer to install latest CRAN version if available & local version < CRAN version

I came across this issue today:

> remotes::install_github("tidyverse/dplyr")
Using github PAT from envvar GITHUB_PAT
Downloading GitHub repo tidyverse/dplyr@master
These packages have more recent versions available.
It is recommended to update all of them.
Which would you like to update?

1: All                                          
2: CRAN packages only                           
3: None                                         
4: vctrs (67c49a1cd... -> d7d4fd378...) [GitHub]

Enter one or more numbers, or an empty line to skip updates:

I don't necessarily want the GH version of vctrs, but my local version of vctrs < CRAN version yet there is no option to install the newer CRAN version on the GH version.

Is this by design, an infelicity, or a bug? Worth reporting? Or am I missing something/some functionality?

Hey, Gavin!

What happens when you select option 2 (install from CRAN)? Does this not update vctrs from CRAN?

Andrie

Hi Andrie! It's been a while :slight_smile:

When I entered 2 it did not update vctrs and then the dplyr install failed because I didn't have the required version. The only way this would complete without error was to manually install vctrs with install.packages('vctrs') and then retry the call shown in my original post.

If you don't want to upgrade from the GitHub version of vctrs then you need to call install.packages("vctrs"), or devtools::install_cran("vctrs").

1 Like

@jimhester I get that; it just struck me as a missing feature to not offer to upgrade to the latest CRAN version (but as I don't use this stuff so often I'm not familiar with all the options available in remotes (devtools) nor have I tracked its development history and kept abreast of earlier issues where this feature might have been discussed).

Given that install_github already offers to upgrade CRAN versions if they're outdated (where there isn't a newer version on GH), it seems sub-optimal to not offer the option to upgrade to latest CRAN version or to the latest GH version.