1

Description of issue - I have recently downloaded R4.0.2 and working via RStudio desktop. For others reasons, I had to install Anaconda (python and R). Since this installation, I have issues for installing packages and find my libraries. Below one example of the error message I get after installing a package and calling it from library.

library(affyPLM) Loading required package: BiocGenerics Error: package or namespace load failed for ‘BiocGenerics’: package ‘BiocGenerics’ was installed before R 4.0.0: please re-install it Error: package ‘BiocGenerics’ could not be loaded

I found a temporary solution by changing the library path at the beginning of the script but I would like to understand what is wrong or missing to

  1. download all packages required per package installed, and
  2. set the correct path to the library.
System Information:
  • RStudio Edition: Desktop
  • RStudio Version: RStudio 1.1.456
  • OS Version: 10.0.17763 N/A Build 17763
  • R Version: R for windows 4.0.2

I am new in posting troubleshooting. Any help will be appreciated. Thanks

Phil
  • 7,287
  • 3
  • 36
  • 66
BIBI
  • 11
  • 3
  • That's a frequent error everybody's getting with R4.0. Reinstall package BiocGenerics and then rerun your `library` command. – Rui Barradas Sep 01 '20 at 06:39
  • To answer 1) Have you run `update.packages(ask = FALSE)` after installing R 4.0.2? 2) You can set the library path in your `R-4.0.2\etc\Rprofile.site` file, see [this SO post](https://stackoverflow.com/questions/15170399/change-r-default-library-path-using-libpaths-in-rprofile-site-fails-to-work). – Rui Barradas Sep 01 '20 at 06:46

1 Answers1

1

This is just because you updated the R version. Packages have to be rebuild / reinstalled. This is somehow annoying - because you have to do it for all packages. (there are also methods to do it directly for all your old packages)

But, whenever you get this error message, you can just:

install.packages("Package_for_which_you_had_the_error", dependencies = T)

And then load the package again

library("Package_for_which_you_had_the_error")

Should work then.

Steffen Moritz
  • 7,277
  • 11
  • 36
  • 55