Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

renv::restore() failing to download packages - potentially due to differences in R versions #1714

Open
luizalmeida93 opened this issue Oct 11, 2023 · 2 comments

Comments

@luizalmeida93
Copy link

luizalmeida93 commented Oct 11, 2023

Hi,

I have a laptop where I conducted all of my statistical analysis 2 years ago. It has R version 4.0.3; hence, Bioconductor is limited to version 3.12 and Biocmanager 1.30.10. I stopped working on it and migrated to a desktop, which is running R 4.2.0 (Bioconductor 3.15.2 and Biocmanager 1.30.19). I had to re-run an analysis, and it gave me slightly different results comparing both systems. This is the moment I realized I needed renv.

Now, I installed renv on both machines, and I am trying to "migrate" the laptop scripts to the desktop. When trying to run renv::restore() on my desktop, using a lock.file for a specific project from the laptop, renv can't install the packages. This is what I did:

  1. created a new folder and a project in R (on my desktop)
  2. ran renv::init()
  3. ran renv::restore(lockfile = "backup_renv.lock")
  4. Console is asking if I want to install BiocManager [1.30.22]. I say "Yes", but this is already a red flag as this version does not match my lock.file
  5. Console then shows all packages in the lock.file and proceeds to install them.
  6. A few get installed, but a bunch have these errors:
Warning: failed to find binary for 'ggrepel 0.9.1' in package repositories
Warning: failed to find source for 'ggrepel 0.9.1' in package repositories
Warning: error downloading 'https://bioconductor.org/packages/3.12/bioc/src/contrib/Archive/ggrepel/ggrepel_0.9.1.tar.gz' [curl: (22) The requested URL returned error: 404]

I have the hypothesis that the difference in R versions is the cause of my issue. I tried installing Biocmanager 1.30.10 and Bioconductor 3.12 before running renv::restore(). Biocmanager installs as expected, but when running BiocManager::install(version = "3.12") I get an error that this version is not compatible with my R version. It seems that R is ok-ish regarding backward compatibility, but Bioconductor is not ok at all running older versions unless you have older R as well.

Does this make sense or am I doing something wrong?

edit1: attached the lock.file as a text file.
backup_renv_text.txt

edit2:
I tested using renv::init(bioconductor = "3.12") to see if it would solve the problem. It did not work when followed by renv::restore(lockfile = "backup_renv.lock"); however, if I use renv::install(), for example renv::install("bioc::[email protected]") then it successfully install the package that would otherwise not be installed by renv::restore().

@kevinushey
Copy link
Collaborator

ggrepel 0.9.1 should be available in the CRAN archive, so I'm surprised this isn't working... it should be unrelated to whether or not you're using Bioconductor.

@luizalmeida93
Copy link
Author

Personally, I was intrigued by the fact that renv::restore() cannot install the package, but running renv::install("bioc::[email protected]") worked perfectly.

Do you need any other info that could help pinpoint the issue?

I still have the laptop with the package versions that were working perfectly; thus, I was considering the "cellar" function available in Renv. My question is, how to back up the packages from the laptop? I was considering the whole library folder (as displayed by .libPaths()); however, they are not in .zip or .tar. If I simply zip each and every one of those folders, would that be accepted by cellar?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants