简体   繁体   中英

failing to install R package: “clusterExperiment”

I am currently having some problems with installing a package in Rstudio. I think my code is correct but it just failed, for many times, using two methods. The result has been pasted here.

Command:

library(devtools)
install_github("epurdom/clusterExperiment")

The first result is for installation from github.

ld: warning: directory not found for option '
L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin15/6.1.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: *** [clusterExperiment.so] Error 1
ERROR: compilation failed for package ‘clusterExperiment’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/clusterExperiment’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/clusterExperiment’
Installation failed: Command failed (1)

Command:

source("https://bioconductor.org/biocLite.R")
biocLite("clusterExperiment")

The second is for installation from Bioconductor.

BioC_mirror: https://bioconductor.org
Using Bioconductor 3.7 (BiocInstaller 1.30.0), R 3.5.1 (2018-07-02).
Installing package(s) ‘clusterExperiment’
试开URL’https://bioconductor.org/packages/3.7/bioc/bin/macosx/el-capitan/contrib/3.5/clusterExperiment_2.0.2.tgz'
Content type 'application/x-gzip' length 11318597 bytes (10.8 MB)
==================================================
downloaded 10.8 MB

The downloaded binary packages are in
/var/folders/rw/m1prpj417277f5fzdbwdxwwh0000gn/T//RtmpCkjRZv/downloaded_packages
Old packages: 'ape'
Update all/some/none? [a/s/n]: 
a

There is a binary version available but the source version is later:
binary source needs_compilation
ape    5.1    5.2              TRUE

Do you want to install from sources the package which needs compilation? (Yes/no/cancel) Yes
installing the source package ‘ape’

## Skip some progress here ##

ld: warning: directory not found for option '-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin15/6.1.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: *** [ape.so] Error 1
ERROR: compilation failed for package ‘ape’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/ape’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/ape’

The downloaded source packages are in
‘/private/var/folders/rw/m1prpj417277f5fzdbwdxwwh0000gn/T/RtmpCkjRZv/downloaded_packages’
Warning message:
In install.packages(update[instlib == l, "Package"], l, repos = repos,  :
installation of package ‘ape’ had non-zero exit status

Does anyone know what happened?

Then I installed homebrew, then gcc, then gfortran (OS X Lion (10.7): download gfortran 4.8.2) Although the package seems to be installed successfully, when I library it, it doesn't work. Rstudio tells that:

package or namespace load failed for ‘clusterExperiment’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]): 
package named ‘robustbase’ doesn't exist.

So I installed robustbase package and then just received some warnings after library

> library(clusterExperiment)
Warning: namespace ‘data.table’ is not available and has been replaced
by .GlobalEnv when processing object ‘slm’
Warning: namespace ‘data.table’ is not available and has been replaced
by .GlobalEnv when processing object ‘slm’
Warning: namespace ‘bigmemory’ is not available and has been replaced
by .GlobalEnv when processing object ‘slm’
Warning: namespace ‘bigmemory’ is not available and has been replaced
by .GlobalEnv when processing object ‘slm’

I hope this will not matter a lot.

The following are all my codes:

source("https://bioconductor.org/biocLite.R")
biocLite("clusterExperiment")

library(clusterExperiment)

install.packages("devtools")
library(devtools)

# install_github("epurdom/clusterExperiment")

source("https://bioconductor.org/biocLite.R")
biocLite("SingleCellExperiment")

install_github("drisso/fletcher2017data")

library(fletcher2017data)
library(SingleCellExperiment)

Looks like you don't have gfortran installed -- use homebrew to install gcc, which will give you Fortran.


Now, you'll need to install.packages("robustbase") .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM