• R语言
  • 载入ggm包时显示graph包不存在

我使用的是4.4.1版本的R语言和最新版的Rstudio,我载入ggm包时显示graph包不存在
<-install.packages("ggm")
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
https://cran.rstudio.com/bin/windows/Rtools/
将程序包安装入‘C:/Users/32043/AppData/Local/R/win-library/4.4’
(因为‘lib’没有被指定)
Warning in install.packages :
没有'‘graph’'这种依赖关系
试开URL’https://cran.rstudio.com/bin/windows/contrib/4.4/ggm_2.5.1.zip'
Content type 'application/zip' length 454179 bytes (443 KB)
downloaded 443 KB
程序包‘ggm’打开成功,MD5和检查也通过
下载的二进制程序包在
C:\Users\32043\AppData\Local\Temp\Rtmpmo3rv0\downloaded_packages里
>- library(ggm)
错误: package or namespace load failed for ‘ggm’ in loadNamespace(j <- imp[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
不存在叫‘graph’这个名称的程序包
> -install.packages("graph")
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

https://cran.rstudio.com/bin/windows/Rtools/
将程序包安装入‘C:/Users/32043/AppData/Local/R/win-library/4.4’
(因为‘lib’没有被指定)
Warning in install.packages :
package ‘graph’ is not available for this version of R
A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages

    lrj 可以具体说下哪里不懂吗?我感觉我引用的报错信息已经很具体了。

    • lrj 回复了此帖

      lrj 现在的报错信息是?请参考新手须知把报错信息用代码块包起来。

      示例:

      ```
      报错信息
      ```
      • lrj 回复了此帖

        CyrusYip

         install.packages("ggm")
        将程序包安装入‘C:/Users/32043/AppData/Local/R/win-library/4.4’
        (因为‘lib’没有被指定)
        Warning in install.packages :
          没有'‘graph’'这种依赖关系
        试开URL’https://cran.rstudio.com/bin/windows/contrib/4.4/ggm_2.5.1.zip'
        Content type 'application/zip' length 454179 bytes (443 KB)
        downloaded 443 KB
        
        程序包‘ggm’打开成功,MD5和检查也通过
        
        下载的二进制程序包在
        	C:\Users\32043\AppData\Local\Temp\RtmpSO7uIA\downloaded_packages里
        > library(ggm)
        错误: package or namespace load failed for ‘ggm’ in loadNamespace(j <- imp[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
         不存在叫‘graph’这个名称的程序包
        > install.packages("graph")
        将程序包安装入‘C:/Users/32043/AppData/Local/R/win-library/4.4’
        (因为‘lib’没有被指定)
        Warning in install.packages :
          package ‘graph’ is not available for this version of R
        
        A version of this package for your version of R might be available elsewhere,
        see the ideas at
        https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages

          lrj 找一下 graph 包的官网,按照文档来装。

          不在 CRAN 的包不能用 install.package 安装,得看它的文档。

          • lrj 觉得很赞
          2 个月 后

          if (!require("BiocManager", quietly = TRUE))
          + install.packages("BiocManager")
          BiocManager::install("graph")

          You can try , Good Luck.