Open rossellhayes opened 1 year ago
What I do is the following.
rlang::check_installed("emo", action = \(pkg, ...) pak::pak("hadley/emo"))
You could pass a more sophisticated function, but at least, it directs you to the correct location.
Edit: The check_installed()
docs could probably be improved, https://github.com/r-lib/rlang/issues/1480#issuecomment-1238451659, #1628
Is it possible to use
check_installed()
to check for and install a remote package? If I use a remote only package, e.g.rlang::check_installed("hadley/emo")
, it fails to detect when the package is installed. If I tryrlang::check_installed("emo")
, it fails to install the package when it is not installed.With
hadley/emo
uninstalledCreated on 2023-08-11 with reprex v2.0.2
With
hadley/emo
installedCreated on 2023-08-11 with reprex v2.0.2