How to install edgeR package using R4.2.0, BiocManager? - r

I tried to install edgeR with the following:
if (!require("BiocManager", quietly = TRUE)); install.packages("BiocManager"; BiocManager::install("edgeR")
This is the message I got
Bioconductor version 3.15 (BiocManager 1.30.18), R 4.2.0 (2022-04-22)
Installing package(s) 'edgeR' Warning: unable to access index for
repository
https://bioconductor.org/packages/3.15/bioc/bin/macosx/big-sur-arm64/contrib/4.2:
cannot open URL
'https://bioconductor.org/packages/3.15/bioc/bin/macosx/big-sur-arm64/contrib/4.2/PACKAGES'
Warning: unable to access index for repository
https://bioconductor.org/packages/3.15/data/annotation/bin/macosx/big-sur-arm64/contrib/4.2:
cannot open URL
'https://bioconductor.org/packages/3.15/data/annotation/bin/macosx/big-sur-arm64/contrib/4.2/PACKAGES'
Warning: unable to access index for repository
https://bioconductor.org/packages/3.15/data/experiment/bin/macosx/big-sur-arm64/contrib/4.2:
cannot open URL
'https://bioconductor.org/packages/3.15/data/experiment/bin/macosx/big-sur-arm64/contrib/4.2/PACKAGES'
Warning: unable to access index for repository
https://bioconductor.org/packages/3.15/workflows/bin/macosx/big-sur-arm64/contrib/4.2:
cannot open URL
'https://bioconductor.org/packages/3.15/workflows/bin/macosx/big-sur-arm64/contrib/4.2/PACKAGES'
Warning: unable to access index for repository
https://bioconductor.org/packages/3.15/books/bin/macosx/big-sur-arm64/contrib/4.2:
cannot open URL
'https://bioconductor.org/packages/3.15/books/bin/macosx/big-sur-arm64/contrib/4.2/PACKAGES'
Package which is only available in source form, and may need
compilation of C/C++/Fortran: ‘edgeR’
Do you want to attempt to install these from sources? (Yes/no/cancel)
so I pressed yes, then,i got the warning message
ld: warning: directory not found for option
'-L/opt/R/arm64/gfortran/lib/gcc/aarch64-apple-darwin20.6.0/12.0.1'
ld: warning: directory not found for option
'-L/opt/R/arm64/gfortran/lib' ld: library not found for -lgfortran
clang: error: linker command failed with exit code 1 (use -v to see
invocation) make: *** [edgeR.so] Error 1 ERROR: compilation failed for
package ‘edgeR’
removing ‘/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/edgeR’
The downloaded source packages are in
‘/private/var/folders/kt/6_fbqvnx7p94hxygb7x6qbnc0000gr/T/RtmpG39FBI/downloaded_packages’
Warning message: In install.packages(...) : installation of package
‘edgeR’ had non-zero exit status
Please advise on what I should to fix this problem.

As a Macbook pro (Monterey) M1 user, I re-installed R package (R-4.2.0.pkg), and removed the old package (R-4.2.0-arm64.pkg). This allowed me to use BiocManager to install other packages.

I'm also on an Apple Silicon Mac. I had assorted previous R installs via homebrew and others. Removing all existing R installations (check via Terminal with 'which R') then reinstalling from a fresh download of the arm64 build did the trick.

Related

Unable to install package "quanteda.textstats" in R under Ubuntu 22.04.1 LTS

I am trying to install the package quanteda.textstats in R under Ubuntu Version 22.04.1 LTS.
I initially ran:
install.packages("quanteda.textstats")
where I got an error message saying it could not install the dependency proxyC. I was able to install that, but I still get an error message when running the above code.
/usr/bin/ld: cannot find -llapack: No such file or directory
/usr/bin/ld: cannot find -lblas: No such file or directory
collect2: error: ld returned 1 exit status
make: *** [/usr/share/R/share/make/shlib.mk:10: quanteda.textstats.so] Error 1
ERROR: compilation failed for package ‘quanteda.textstats’
* removing ‘/home/user/R/x86_64-pc-linux-gnu-library/4.2/quanteda.textstats’
Warning in install.packages :
installation of package ‘quanteda.textstats’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpuUtAq1/downloaded_packages’
I would guess I am missing certain dependencies, but I am unable to figure out what -llapack and -lblas stands for.
I also tried running the github install (option 3):
remotes::install_github("quanteda/quanteda.textstats")
but there as well I get a similar error:
/usr/bin/ld: cannot find -llapack: No such file or directory
/usr/bin/ld: cannot find -lblas: No such file or directory
collect2: error: ld returned 1 exit status
make: *** [/usr/share/R/share/make/shlib.mk:10: quanteda.textstats.so] Error 1
ERROR: compilation failed for package ‘quanteda.textstats’
* removing ‘/home/user/R/x86_64-pc-linux-gnu-library/4.2/quanteda.textstats’
Warning message:
In i.p(...) :
installation of package ‘/tmp/RtmpuUtAq1/file17581cc7f39c/quanteda.textstats_0.96.tar.gz’ had non-zero exit status
Can anybody help please?
Your are trying to compile the package which requires to have certain system dependencies installed, in this case lblas and llapack. This is not the recommended way to install R packages on Ubuntu. Instead you should install them as PPAs as described on CRAN.
If you insist on compiling the package yourself, install the dependencies via apt in the system terminal:
sudo apt-get install libblas-dev liblapack-dev

Installing R package from CRAN archive has non-zero exit status

I need to install fwildclusterboot, a package that has been removed from CRAN.
I tried installing it as follows:
library(devtools)
install_url("https://cran.r-project.org/src/contrib/Archive/fwildclusterboot/fwildclusterboot_0.9.tar.gz")
However, I end up getting the following error message at the end of the installation process (I have a MacBook, MacOS Monterey 12.5.1, and my RStudio is version 2022.07.1):
ld: warning: directory not found for option '-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin18/8.2.0'
ld: warning: directory not found for option '-L/usr/local/gfortran/lib'
ld: library not found for -lgfortran
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [fwildclusterboot.so] Error 1
ERROR: compilation failed for package ‘fwildclusterboot’
* removing ‘/Library/Frameworks/R.framework/Versions/4.2/Resources/library/fwildclusterboot’
Warning message:
In i.p(...) :
installation of package ‘/var/folders/1n/m1g55_416rj6m4w3v6v9x2340000gn/T//RtmppWJnds/fileaae0dc5e6aa/fwildclusterboot_0.9.tar.gz’ had non-zero exit status
How can I solve this?
I had the same problem some months before, this is the easy way,
Go to: https://github.com/fxcoudert/gfortran-for-macOS/releases an you'll find the lastest version for Monterey with an easy installer (.dmg), select depending if you have an ARM or Intel based computer.

problem installing ComplexHeatmap. ERROR: compilation failed for package ‘cluster’

i am installing an R package called complex heatmaps (https://jokergoo.github.io/ComplexHeatmap-reference/book/). I get this error. So far i just identified it might be do to this package : https://packages.debian.org/buster/r-cran-cluster but i am not sure what to do at all. Thats why i am writing you.
Thanks a lot for your help
/usr/bin/ld: cannot find -lgfortran
collect2: error: ld returned 1 exit status
/usr/share/R/share/make/shlib.mk:6: recipe for target 'cluster.so' failed
make: *** [cluster.so] Error 1
ERROR: compilation failed for package ‘cluster’
* removing ‘/home/luca/R/x86_64-pc-linux-gnu-library/3.6/cluster’
Error: Failed to install 'ComplexHeatmap' from GitHub:
(converted from warning) installation of package ‘cluster’ had non-zero exit status
The error message indicates that you are missing libfortran.so. You might even miss more tools necessary for installing R packages from source. How to install this depends on the Linux distribution you are using. For Debian, which you mention in the question, this would be
sudo apt install r-base-dev
If you want to speed up package installation, you can also use the binary packages available in Debian, i.e.
sudo apt install r-cran-cluster

How can I deal with this nloptr error in R?

init_nloptr.c:35:10: fatal error: 'nlopt.h' file not found
#include "nlopt.h"
^~~~~~~~~
1 error generated.
make: *** [init_nloptr.o] Error 1
ERROR: compilation failed for package 'nloptr'
* removing '/Library/Frameworks/R.framework/Versions/3.5/Resources/library/nloptr'
Warning in install.packages :
installation of package 'nloptr' had non-zero exit status
I got this error message when I installed nloptr package which need to install mi package.
From the path showing up in the error message, it looks like you're running on macOS.
If so, you must install the nlopt system library before installing nloptr.
Hopefully you have Homebrew installed (if not, please reply/comment and I will attach some further info), hence open the Terminal and run
brew install nlopt
At the end of the brew install command, go back to R and install nloptr.

Install ggplot2 on opensuse 11.4

I'm trying to install ggplot2, however I get the following error:
trying URL
'http://cran.skazkaforyou.com/src/contrib/ggplot2_0.8.9.tar.gz'
Content type 'application/x-gzip' length 2074749 bytes (2.0 Mb) opened
URL
================================================== downloaded 2.0 Mb
* installing source package ‘plyr’ ...
** libs
sh: make: command not found
ERROR: compilation failed for package ‘plyr’
* removing
‘/home/jayron/R/x86_64-unknown-linux-gnu-library/2.12/plyr’
* installing source package ‘digest’ ...
** libs sh: make: command not found
sh: make: command not found ERROR: compilation failed for package
‘colorspace’
ERROR: dependencies ‘reshape’, ‘plyr’, ‘digest’, ‘colorspace’ are not
available for package ‘ggplot2’
* removing ‘/home/jayron/R/x86_64-unknown-linux-gnu-library/2.12/ggplot2’
The downloaded packages are in
‘/tmp/Rtmp0Sgoxp/downloaded_packages’
any help please?
Try the following code:
install.packages("ggplot2", repos = "http://cran.r-project.org")
You need development packages. Unless someone has packaged a recent Ggplot2 for opensuse, you will need to install these using (I think) zypper. The error message says you do not have 'make' on your system. It is likely that there will be more.
You need development packages. Until someone has packaged a recent ggplot2 for opensuse, which has not yet happened yet today (Jan 2014), you will need to be root to install these using zypper:
# zypper install r-base-devel
This package exists since opensuse 11.3.
The error message says you do not have 'make' on your system. If you only install 'make', it is likely that there will be more similiar errors. Thus you need to install all development tools needed for ggplot2. This can be done by root with
# zypper install -t pattern devel_C_C++

Resources