gpt4 book ai didi

r - 从 github 安装 ggbiplot

转载 作者:行者123 更新时间:2023-12-03 14:52:07 25 4
gpt4 key购买 nike

我正在尝试安装 ggbiplot 的开发版本来自 Github .在安装过程中,我收到以下错误消息:

library(devtools)
install_github("ggbiplot", "vqv")


Installing github repo(s) ggbiplot/master from vqv
Installing ggbiplot.zip from https://github.com/vqv/ggbiplot/zipball
Installing ggbiplot
* checking for file 'C:\Users\Muhammad Yaseen\AppData\Local\Temp\Rtmpsx4n5u\vqv-ggbiplot-2623d7c/DESCRIPTION' ... OK
* preparing 'ggbiplot':
* checking DESCRIPTION meta-information ... OK
* checking for LF line-endings in source and make files
* checking for empty or unneeded directories
* looking to see if a 'data/datalist' file should be added
* building 'ggbiplot_0.5.tar.gz'
cygwin warning:
MS-DOS style path detected: C:/Users/MUHAMM~1/AppData/Local/Temp/Rtmpsx4n5u/ggbiplot_0.5.tar.gz
Preferred POSIX equivalent is: /cygdrive/c/Users/MUHAMM~1/AppData/Local/Temp/Rtmpsx4n5u/ggbiplot_0.5.tar.gz
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames

Warning: invalid package 'Yaseen/R/win-library/2.14'
Error: ERROR: cannot cd to directory 'C:/Users/Muhammad'
Error: Command failed (1)
In addition: Warning message:
running command '"C:/PROGRA~1/R/R-214~1.2/bin/i386/R" CMD INSTALL C:\Users\MUHAMM~1\AppData\Local\Temp\Rtmpsx4n5u/ggbiplot_0.5.tar.gz --library=C:/Users/Muhammad Yaseen/R/win-library/2.14' had status 1

任何想法来解决这个问题。提前感谢您的帮助和时间。

编辑

从Github下载后,也试过
install.packages("vqv-ggbiplot-2623d7c.tar.gz", repos=NULL, type="source")

产生了这个错误信息
Installing package(s) into ‘C:/Users/Muhammad Yaseen/R/win-library/2.14’
(as ‘lib’ is unspecified)
Error in untar2(tarfile, files, list, exdir) : unsupported entry type 'g'
Warning messages:
1: running command 'C:/PROGRA~1/R/R-214~1.2/bin/i386/R CMD INSTALL -l "C:/Users/Muhammad Yaseen/R/win-library/2.14" "vqv-ggbiplot-2623d7c.tar.gz"' had status 1
2: In install.packages("vqv-ggbiplot-2623d7c.tar.gz", repos = NULL, :
installation of package ‘vqv-ggbiplot-2623d7c.tar.gz’ had non-zero exit status

最佳答案

这是因为你的 Rlib 路径中有一个空格:C:/Users/Muhammad Yasseen/R/win-library/2.14 .

查看第一个错误日志中的警告消息如何

running command '"C:/PROGRA~1/R/R-214~1.2/bin/i386/R" CMD INSTALL 
C:\Users\MUHAMM~1\AppData\Local\Temp\Rtmpsx4n5u/ggbiplot_0.5.tar.gz
--library=C:/Users/Muhammad Yaseen/R/win-library/2.14'
had status 1

特别是 --library=C:/Users/Muhammad Yaseen/R/win-library/2.14 .

这应该是 --library="C:/Users/Muhammad Yaseen/R/win-library/2.14"来处理空间。

使用 install.packages为您处理引号 - 看看您的第二条警告消息(当您使用 install.packages 时)是如何
running command 'C:/PROGRA~1/R/R-214~1.2/bin/i386/R CMD INSTALL 
-l "C:/Users/Muhammad Yaseen/R/win-library/2.14"
"vqv-ggbiplot-2623d7c.tar.gz"' had status 1
-l "C:/Users/Muhammad Yasseen/R/win-library/2.14"它周围有引号,所以你不会得到同样的错误。

我快速浏览了 install-github源,并构建 R CMD INSTALL命令通过:
paste("CMD INSTALL ", built_path, " --library=", .libPaths()[1], sep="")

看看它如何不包围 .libPaths()[1]在空格的情况下用双引号?我猜那是你的问题。

至于修复 - 使用 install.packages() 似乎有错误在 git 生成的 tar 文件上(据报道 here )。因此,您可以:
  • 将您的 R 库位置更改为没有空格的地方
  • 解压 .tar.gz文件(我不知道是什么软件在 Windows 上执行此操作)并从提取的目录而不是 .tar.gz 安装.
  • 关于r - 从 github 安装 ggbiplot,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9676894/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com