R语言中使用pkgbuild::find_rtools(debug = TRUE)查看是否有Rtools、使用Sys.which函数查看make是否存在、如果没有则安装Rtools、使用writeLines函数绑定R和Rtools
目录
#R语言中使用pkgbuild::find_rtools(debug = TRUE)查看是否有Rtools、使用Sys.which函数查看make是否存在、如果没有则安装Rtools、使用writeLines函数绑定R和Rtools
确实没有找到make所以没法安装。
Sys.which(“make”)
make
“”pkgbuild::find_rtools(debug = TRUE)
Found in Rtools 4.0 installation folder
[1] TRUEinstall.packages(“D:/Downloads/RGtk2_2.20.36.3.tar.gz”, repos = NULL, type = “source”)
* installing source package ‘RGtk2’ …
成功将’RGtk2’程序包解包并MD5和检查
using staged installation
** libs
*** arch – i386
Warning in system(cmd) : ‘make’ not found
ERROR: compilation failed for package ‘RGtk2’
* removing ‘D:/R/R-4.0.5/library/RGtk2’
Warning in install.packages :
installation of package ‘D:/Downloads/RGtk2_2.20.36.3.tar.gz’ had non-zero exit status
#安装Rtools
#使用writeLines函数绑定R和Rtools
如下操作(记得如果操作之后没有反应,需要重启Rstudio)
writeLines(‘PATH=”${RTOOLS40_HOME}\usr\bin;${PATH}”‘, con = “~/.Renviron”)
Sys.which(“make”)
make
“D:\Rtools\rtools40\usr\bin\make.exe”
参考:R
参考:Index of /src/contrib/Archive/RGtk2
Original: https://blog.csdn.net/zhongkeyuanchongqing/article/details/122903360
Author: Data+Science+Insight
Title: R语言中使用pkgbuild::find_rtools查看是否有Rtools、使用Sys.which函数查看make是否存在、如果没有则安装、使用writeLines函数绑定R和Rtools
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/695824/
转载文章受原作者版权保护。转载请注明原作者出处!