无法安装R包:“ clusterExperiment”

时间:2018-09-26 23:02:31

标签: r

我目前在Rstudio中安装软件包时遇到一些问题。 我认为我的代码是正确的,但是使用两种方法多次失败。 结果已粘贴到此处。

命令:

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

第一个结果是从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)

命令:

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

第二个是从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

有人知道发生了什么事吗?

然后我先安装了Homebrew,然后安装了gcc,然后安装了gfortran(OS X Lion(10.7):下载gfortran 4.8.2)尽管该软件包似乎已成功安装,但是当我将其装入库时,它无法正常工作。 Rstudio告诉您:

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

所以我安装了robustbase软件包,然后在库之后收到一些警告

> 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’

我希望这无关紧要。

以下是我所有的代码:

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)

1 个答案:

答案 0 :(得分:0)

看起来您没有安装gfortran,请使用自制软件安装gcc,这将为您提供Fortran。


现在,您需要install.packages("robustbase")