> require("caret")
Loading required package: caret
Loading required package: lattice
Loading required package: ggplot2
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called ‘pbkrtest’
所以我发现缺少&#34; pbkrtest&#34;然后我试着重新安装它。
> install.packages("pbkrtest")
Installing package into ‘C:/Users/ADMIN/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
There is a binary version available but the source version is
later:
binary source needs_compilation
pbkrtest 0.4-2 0.4-3 FALSE
installing the source package ‘pbkrtest’
trying URL 'https://rweb.crmda.ku.edu/cran/src/contrib/pbkrtest_0.4- 3.tar.gz'
Content type 'application/x-gzip' length 164415 bytes (160 KB)
downloaded 160 KB
* installing *source* package 'pbkrtest' ...
** package 'pbkrtest' successfully unpacked and MD5 sums checked
** R
** data
** inst
** preparing package for lazy loading
Warning: replacing previous import by 'stats::sigma' when loading 'pbkrtest'
Error : object 'sigma' is not exported by 'namespace:stats'
ERROR: lazy loading failed for package 'pbkrtest'
* removing 'C:/Users/ADMIN/Documents/R/win-library/3.2/pbkrtest'
The downloaded source packages are in
‘C:\Users\ADMIN\AppData\Local\Temp\Rtmpk7mJT0\downloaded_packages’
Warning messages:
1: running command '"D:/R-3.2.3/bin/x64/R" CMD INSTALL -l
"C:\Users\ADMIN\Documents\R\win-library\3.2"
C:\Users\ADMIN\AppData\Local\Temp\Rtmpk7mJT0/downloaded_packages/pbkrtest_0.4- 3.tar.gz' had status 1
2: In install.packages("pbkrtest") :
installation of package ‘pbkrtest’ had non-zero exit status
似乎安装失败了。 结果,我无法使用插入包来使用其他代码。
答案 0 :(得分:2)
我在Windows 7上也遇到了这个问题。我按顺序执行了以下步骤并且它有效。 a)确保您的R版本更新最新的R版本3.2.3 b)默认源似乎是安装Unix版本。所以我为Windows手动下载了https://cran.r-project.org/web/packages/pbkrtest/index.html c)使用R菜单中的手动安装功能来安装包。
干杯, 拉坦
答案 1 :(得分:0)
version
检查R的版本。
如果版本不“ version.string R版本3.3.2 ”或更高版本install.packages("caret")
”安装软件包。require(caret)
。?createDataPartition
进行测试。