You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From my experience, renv::restore() frequently fails for all sorts of different reasons related to installation issues with various packages. I don't think it should. If a package installation fails, it should keep track of that package and move on. At the end of restore, it should return a list of packages that failed to install. If not the default, this should at least be an option.
An even better option if installation fails, is that it should attempt to install the latest/current version of that package. Usually, I am fine with that as the exact version doesn't matter. Again this could be a user specified option.
My current solution to do this manually. Something like this using renv::install() is also not reliable:
for (iin1:nrow(pkgdf)) {
pkg<-pkgdf$Package[i]
tryCatch(
{
if (!pkg%in% rownames(installed.packages())) renv::install(paste0(pkg,"@", pkgdf$Version[i]), prompt=FALSE)
},
error=function(e) {
renv::install(pkg, prompt=FALSE)
}
)
}
So, I have switched to remotes and this seems to be more reliable.
for (iin1:nrow(pkgdf)) {
pkg<-pkgdf$Package[i]
tryCatch(
{
if (!pkg%in% rownames(installed.packages())) remotes::install_version(pkg, version=pkgdf$Version[i], upgrade="never")
},
error=function(e) {
install.packages(pkg)
}
)
}
That was for CRAN/RSPM packages. Packages from bioconductor, github etc needs to be handled separately. I also miss out on caching. Is there a better way to do this? Am I missing something?
The text was updated successfully, but these errors were encountered:
From my experience,
renv::restore()
frequently fails for all sorts of different reasons related to installation issues with various packages. I don't think it should. If a package installation fails, it should keep track of that package and move on. At the end of restore, it should return a list of packages that failed to install. If not the default, this should at least be an option.An even better option if installation fails, is that it should attempt to install the latest/current version of that package. Usually, I am fine with that as the exact version doesn't matter. Again this could be a user specified option.
My current solution to do this manually. Something like this using
renv::install()
is also not reliable:So, I have switched to remotes and this seems to be more reliable.
That was for CRAN/RSPM packages. Packages from bioconductor, github etc needs to be handled separately. I also miss out on caching. Is there a better way to do this? Am I missing something?
The text was updated successfully, but these errors were encountered: