Remote dependencies don't install with `devtools::install_github()`

I have built an R package ("KuskoHarvEst") hosted on GitHub that depends on another package I have hosted on GitHub ("KuskoHarvUtils"). I want users to be able to install both packages just by installing the first. I do not plan to submit these packages to CRAN given their niche appeal.

According to this devtools vignette, this should be possible via the Remotes field in the DESCRIPTION file:

Remotes: github::bstaton1/KuskoHarvUtils

However, I have done this, and devtools::install_github() still only installs the first package.

To reproduce, please run:

devtools::install_github("bstaton1/KuskoHarvEst", ref = "install-remotes")

When I do this, the remote dependency 'KuskoHarvUtils' is not installed, only 'KuskoHarvEst'. Any recommendations to get the desired behavior are appreciated, thank you!

Can you show the full DESCRIPTION file , and also the full output of devtools::install_github()?

Here is the full DESCRIPTION file (note I'm working from the branch install-remotes here, not from the main branch):

Package: KuskoHarvEst
Title: Tools for Producing In-season Estimates of Salmon Harvest and Effort Occurring in Short-Duration Subsistence Harvest Opportunities in the Lower Kuskokwim River
Version: 1.2.4
Authors@R: 
    person(given = "Ben",
           family = "Staton",
           role = c("aut", "cre"),
           email = "bstaton.qes@gmail.com",
           comment = c(ORCID = "0000-0002-2342-3482"))
Description: This package contains two main types of functionality to facilitate harvest and effort estimation.
    First, there are "core" functions that handle data processing and estimation tasks. However, many potential users
    of this package are not R programmers, and so the second type of functionality is to enable interactive and automated
    creation of estimates and reports. The intent is to place the emphasis of the analyst on the raw data files
    rather than on the intracacies of estimation and automated reporting. 
License: use_mit_license()
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
Depends: 
    R (>= 4.1.0)
Imports:
    shiny (>= 0.13),
    miniUI (>= 0.1.1),
    shinyTime,
    rstudioapi (>= 0.5),
    lubridate,
    stringr (>= 1.3.1),
    reshape2,
    shinyjs,
    DT,
    rmarkdown,
    knitr,
    kableExtra,
    tinytex,
    latex2exp,
    yaml,
    settings
Remotes: github::bstaton1/KuskoHarvUtils

Here is the complete output of running devtools::install_github("bstaton1/KuskoHarvEst", ref = "install-remotes"):

── R CMD build ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
βœ”  checking for file 'C:\Users\bstaton\AppData\Local\Temp\RtmpOEJ81L\remotes2d885c6b7888\bstaton1-KuskoHarvEst-e8e252f/DESCRIPTION' ...
─  preparing 'KuskoHarvEst': (375ms)
βœ”  checking DESCRIPTION meta-information ... 
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
   Omitted 'LazyData' from DESCRIPTION
─  building 'KuskoHarvEst_1.2.4.tar.gz'
   
Installing package into β€˜C:/Users/bstaton/AppData/Local/R/win-library/4.3’
(as β€˜lib’ is unspecified)
* installing *source* package 'KuskoHarvEst' ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (KuskoHarvEst)

It installs 'KuskoHarvEst' without issue as instructed and as expected, but the remote dependency is not found, as I would expect it to be:

> packageVersion("KuskoHarvEst")

[1] β€˜1.2.4’
> packageVersion("KuskoHarvUtils")

Error in packageVersion("KuskoHarvUtils") : 
  there is no package called β€˜KuskoHarvUtils’

I really appreciate your help in figuring this out!

You need to put KuskoHarvUtils into Imports or Depends (or Suggests and install all soft dependencies), in addition to Remotes. R needs to know what kind of dependency it is.

1 Like

Oh that's embarrassing. I totally was viewing Remotes as replacing Imports, but of course R needs to know what kind of a dependency it is, not just where to find it.

Thank you very much for your time and assistance, this has been annoying me for a long time with this family of packages, and I can finally resolve it!

No worries, you are not the first (or last) to get confused by this. We had discussions about changing it, and we should probably at least add a warning if we decide to keep the current behavior: Consider packages listed in remotes as dependencies Β· Issue #496 Β· r-lib/pak Β· GitHub

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.