R - error installing caret package

2019-04-12 04:39发布

> Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()),
> versionCheck = vI[[j]]) :    namespace ‘pbkrtest’ 0.4-2 is being
> loaded, but >= 0.4.4 is required  
> Error: package or namespace load
> failed for ‘caret’

Caret was working fine until I tried to load Rcpp and it messed everything up.

I searched the answers for a similar problem with caret but the solutions posted did not seem to work on mine. I followed:

install.packages("caret", dependencies = TRUE) 

But it did not work.

7条回答
祖国的老花朵
2楼-- · 2019-04-12 05:10

I would suggest you to check the R version. I updated the version to 3.5.1 and it works perfectly :)

Mac only – use updateR

Similar to installr, updateR is the package to help updating R on Mac OS.

The R code you will need is these 5 lines:

install.packages('devtools') #assuming it is not already installed

library(devtools)

install_github('andreacirilloac/updateR')

library(updateR)

updateR(admin_password = 'Admin user password')

查看更多
神经病院院长
3楼-- · 2019-04-12 05:17

I have faced this issue and tried many ways but followed r console about error thrown and started downloading packages one by one. steps noted down what i did for this. y r studio version is "R version 3.4.4"

First install.packages("caret"), install.packages("ggplot2"), install.packages("lattice"), install.packages("lava")..

then load library(ggplot2) then library(lattice) then library(lava) and then finally library(caret).

What i believe that caret have these packages dependency so once caret is installed ideally 'install.packages('caret', dependencies = TRUE)' should work but it was not working in my R version so i did the step as given above and it worked for me.

hope it may work if someone get this issue

查看更多
男人必须洒脱
4楼-- · 2019-04-12 05:24

I have the same problem with my dynlm package. I get the same error. But as R states pbkrtest is required. This package isn't available under R 3.2.3. However you can download the package online, look a bit further on this site, the question is already asked on stackoverflow and they gave a site where you can find the packages. Then write the following code:

install.packages("...",repos = NULL, type="source")
install.packages("pbkrtest", dependencies = TRUE) 

In the first line, here I wrote the 3 dots you need to write the path to the file where you placed the pbkrtest-package.

查看更多
不美不萌又怎样
5楼-- · 2019-04-12 05:34

I did try all the above mentioned ways to install and activate caret but none worked for me. finally what I did was to go to my drive location where R libraries are located. I removed a folder called "caret" and then in R studio I run "remove.packeges("caret")" to remove the caret package. then I reinstalled the package. install.packages("caret") library(caret) it worked for me.

查看更多
相关推荐>>
6楼-- · 2019-04-12 05:35

I also faced the same problem with caret package and I could solve it as the following:

install.packages("lme4", dependencies = TRUE)
library(lme4)
methods(sigma)
install.packages("pbkrtest", dependencies = TRUE)
library(caret)

This worked for me!

查看更多
可以哭但决不认输i
7楼-- · 2019-04-12 05:36

Try install.packages('DEoptimR') and followed by install.packages("caret", dependencies = TRUE). I had the same issues. This command worked for me.

查看更多
登录 后发表回答