简体   繁体   English

R如何安装软件包'graph'?

[英]R How to install package 'graph'?

The package graph isn´t available on CRAN anymore. graph不再适用于CRAN。 I found that it has moved to Bioconductor, see 我发现它已转移到Bioconductor,见

Bioconductor - graph Bioconductor - 图表

But actually, if I try to run the commands they advise to run 但实际上,如果我尝试运行他们建议运行的命令

install.packages("BiocInstaller")
source("http://bioconductor.org/biocLite.R")
biocLite("graph")

I get the error that even the BiocInstaller is not available for the latest R version 3.4.2 我得到的错误是即使BiocInstaller也没有最新的R版本3.4.2

How can I install this package? 我该如何安装这个包?

See if this works: 看看这是否有效:

First, download the zip file from http://www.bioconductor.org/packages/release/bioc/html/graph.html 首先,从http://www.bioconductor.org/packages/release/bioc/html/graph.html下载zip文件

Second, install the package locally: 其次,在本地安装包:

install.packages("yourpath/graph_1.56.0.zip",repos=NULL)

Then, library(graph) will load the package. 然后, library(graph)将加载包。 You'll get a warning message the package was created unter a different version of R, but it will likely work this way. 您将获得一个警告消息,该包是在不同版本的R上创建的,但它可能会以这种方式工作。

Don't use this command: install.packages("BiocInstaller") 不要使用此命令: install.packages("BiocInstaller")

This page crosswalks Biconductor version to R version https://www.bioconductor.org/about/release-announcements/ 此页面穿越Biconductor版本到R版本https://www.bioconductor.org/about/release-announcements/

> Release   R
> 3.7, 3.8  3.5
> 3.5, 3.6  3.4
> 3.3, 3.4  3.3

For R 3.4.2 you need Bioconductor 3.6 https://www.bioconductor.org/packages/3.6/bioc/html/graph.html 对于R 3.4.2,您需要Bioconductor 3.6 https://www.bioconductor.org/packages/3.6/bioc/html/graph.html

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

See the instructions at http://www.bioconductor.org/packages/release/bioc/html/graph.html : 请参阅http://www.bioconductor.org/packages/release/bioc/html/graph.html上的说明:

Installation 安装

To install this package, start R (version "3.5") and enter: 要安装此软件包,请启动R(版本“3.5”)并输入:

if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")
BiocManager::install("graph", version = "3.8")

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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