今天做BP神经网络和SVM,想安装AMORE包,输入以下代码:
1install.packages("AMORE")
报错:
Warning in system(cmd) : 'make' not found
ERROR: compilation failed for package 'AMORE'
经过搜索,得出以下解决方法:
Step 0. 将Rstudio更新到最新版本:
1
2
3install.packages("installr") library(installr) updateR()
Step 1. 网页下载安装RTools:
R for Windows Build Tools Archive (tsinghua.edu.cn)
安装版本:rtools40v2-x86_64.exe
Step 2. 运行代码:
1
2writeLines('PATH="${RTOOLS40_HOME}\usr\bin;${PATH}"', con = "~/.Renviron") Sys.which("make")
能显示“make”路径即可。
"D:\rtools40\usr\bin\make.exe"
Step 3. 尝试安装jsonlite包,安装成功即代表RTools 可使用。
1install.packages("jsonlite", type = "source")
Step 4. 安装原本报错的包,仍然报错:
1install.packages("AMORE")
Warning in install.packages :
package ‘AMORE’ is not available for this version of RA 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
于是改换安装方法,进行本地安装。官网下载该包的压缩包形式后,进行安装:
1install.packages("C:/Users/.../AppData/Local/Temp/AMORE_0.2-16.tar.gz", repos = NULL, type = "source")
……
* DONE (AMORE)
Making 'packages.html' ... done
调用该包:
1library("AMORE")
无报错信息。newff等函数均可正常使用。
贴大佬教程:
Rtools下载与安装(win10) - 知乎 (zhihu.com)
最后
以上就是默默茉莉最近收集整理的关于Rstudio安装R包报错:Warning in system(cmd) : ‘make‘ not found的全部内容,更多相关Rstudio安装R包报错:Warning内容请搜索靠谱客的其他文章。
发表评论 取消回复