方法一:CRAN下载
CRAN - Package DMwR2 (r-project.org)https://cran.r-project.org/web/packages/DMwR2/index.html注意:下载R包的网址
https://cran.r-project.org/web/packages/DMwR2/index.html
搜索其他包的时候把DMwR2换成想要找的包的名字即可
在当前页面下:
也可以把该包的压缩包下载之后导入到包对应的目录下
方法二:GitHub下载
注意:该方法可以找到一些在CRAN已经没有了的R包,如DMwR
1.打开GitHub:GitHub: Where the world builds software · GitHub
2.搜索DMwR:
3. R包-DMwR2安装代码
install.packages('devtools') #if you not installed devtools
注意:①和②的代码选择一个就行了
①安装官方稳定版
library(devtools) # You need to install this package!
install_github("ltorgo/DMwR2",ref="master")
②安装开发板
library(devtools) # You need to install this package!
install_github("ltorgo/DMwR2",ref="develop")
4.同理修改代码
把Itorgo/DMwR2改成红色框框内cran/DMwR
library(devtools) # You need to install this package!
install_github("cran/DMwR",ref="master")
library(DMwR)