Best approach for making DESCRIPTION file enforcing import pkgs from RSutdio package-manager

Desired goal: have install.packages("mypkg") install the the latest version of dependency package pkgx from local package manager.

Current approach: To get the latest dependency package, pkgx, installed as part of installing mypkg, I have used Remotes in DESCRIPTION file of mypkg.

The relevant chunk of DESCRIPTION looks like below


I can try to point installation to pkg-manager via url:: as given below


This almost works except it is pointing to a specific version as opposed to the latest.

Question: Is there a way to ensure internal pkgx is installed (note there is a CRAN version of pkgx that I don't want) without having to rely the user of mypkg having to get the repos specified correctly at the install?

:wave: @amashadi, I do not think you can do that for install.packages().

  • The Remotes field is not recognized by base R.

  • The Additional_repositories field is only used to see whether a package can be found, it is not used automatically at installation.

Now with the pak or remotes package, you might be able to tweak installation a bit more e.g. via the upgrade argument in pak Install a package — pkg_install • pak (and both pak and remotes use the Remotes field).

Thank you @maelle! I'll take a closer look at pkg_install

1 Like

This topic was automatically closed after 45 days. 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.