I am trying to install Bioconductor into R, using the code on their website. When I type in the code (see bellow) I get an error message saying that some packages can\'t be
One solution is to open a terminal and load R using admin rights
sudo R
update.packages()
source("https://bioconductor.org/biocLite.R")
biocLite()
Then you can update. But careful. This can create packages by the admin in a directory supposed to be owned by a user.
In this case, instead of loading R as root (which is solving the problem until the next update), check the .libPaths(). You will have a list of directories.
.libPaths()
"/home/it_s_me/R/x86_64-pc-linux-gnu-library/3.4" "/usr/lib/R/library"
In my case, all packages in "/usr/lib/R/library" are owned by root, and all except one are owned by a normal user (not root) at "/home/itsame/R/x86_64-pc-linux-gnu-library/3.4".
If you have admin rights, an easy solution may be to run chown in all the places: For example, I had trouble updating the curl package. I used:
sudo chown -R it_s_me /home/it_s_me/R/x86_64-pc-linux-gnu-library/3.4/curl/
Since with the version of R 3.6.1 the script http://bioconductor.org/biocLite.R returns this message " Error: With R version 3.5 or greater, install Bioconductor packages using BiocManager; see https://bioconductor.org/install " I solved the problem with the following steps:
.libPaths()
install.packages("BiocManager")
BiocManager::install("Rgraphviz", lib = "C:/Users/tizbet/Documents/R/win-library/3.6")
I worked on the following R installation:
platform x86_64-w64-mingw32
, arch x86_64
, os mingw32
, system x86_64, mingw32
, version.string R version 3.6.1 (2019-07-05)
I was inspired by the Kasper Thystrup Karstensen answer
Correct way to resolve this problem is as followed:
sudo R
update.packages()
Summary is, some latest packages are required and updating those on admin mode solve this issue. `
Quit R by typing q() and enter then type again sudo R and hit enter for mew package installation.
I solved it by opening Rstudio as administrator.