Here is my goal: update package versions in renv.lock using rstudio package-manager as the source.
Issue: I could not see a convenient way from renv to do that
renv::update seems to be the right function, but it looks at CRAN and GitHub at this point and does not provide ways of explicitly providing a url to internal package repository.
Question: What's the best way to manage package updates in renv.lock when your source is not CRAN, GitHub or a local file system?
There isn't a convenience function for doing this right now, but in theory, since renv.lock is just JSON, you could do something like:
Set your R repository to point to RSPM; e.g. with options(repos = <RSPM URL>),
Request available packages + their versions,
Read the renv lockfile (as JSON),
For each package record, update the version based on the version seen in (2),
Write the lockfile back out.
The main thing you'd need to be careful of is whether the dependencies required by different packages changed. You might ultimately just want to file a feature request at Issues · rstudio/rstudio · GitHub.
Thanks @kevinushey! Before posting, I tried something along these lines but I must have done something not correctly as it failed. I'll give this a shot and if this is already not on the roadmap, I'd be happy to put in a feature request.
Thanks for this great package!!