2

I am trying to set up a packrat project but it keeps failing because one of the packages (installed from GitHub) depends on a package that doesn't currently have a binary version on CRAN. This is the error message I receive:

> remotes::install_github("BroVic/raampGBV")
Downloading GitHub repo BroVic/raampGBV@master
Skipping 1 packages not available: naijR
Installing 114 packages: DBI, RSQLite, ... 
Installing packages into ‘C:/Users/Admn/project/packrat/lib/x86_64-w64-mingw32/3.6.2’
(as ‘lib’ is unspecified)

   package ‘naijR’ is available as a source package but not as a binary


  There are binary versions available (and will be
  installed) but the source versions are later:
        binary source
digest  0.6.23 0.6.24
stringi  1.4.4  1.4.5
callr    3.4.1  3.4.2
ps       1.3.0  1.3.1

Error: Failed to install 'raampGBV' from GitHub:
  (converted from warning) package ‘naijR’ is not available (as a binary package for R version 3.6.2)

Again, to be clear, raampGBV exists only on GitHub (it's a project-specific package) while naijR is on CRAN. When I try to install raampGBV on its own, the naijR source package is downloaded and installed from CRAN without any issue. But when attempted via packrat, it fails.

zx8754
  • 52,746
  • 12
  • 114
  • 209
BroVic
  • 979
  • 9
  • 26

1 Answers1

2

According to NEWS for R 3.6.2:

For a Windows or Mac OS X binary package install, install.packages() will check if a source package is available on the same repositories, and report if it is a later version or there is a source package but no binary package available. This check can be suppressed: see the help page.

Upon examining the Binary packages section of ?install.packages(), it is evident that the type parameter is what is used to control the behaviour referred to in the quote above. The default argument for type in install.packages is getOption("pkgType"), which in my case returned "win.binary". This is how the issue was fixed:

oldOpt <- getOption("pkgType")
options(pkgType = "both")

remotes::install_github("BroVic/raampGBV")

options(pkgType = oldOpt)

The dependencies are now properly installed in the packrat library.

BroVic
  • 979
  • 9
  • 26