我安装了汽车包后,我无法加载工资数据集

时间:2016-08-29 13:54:06

标签: r

 > r#quire(car)        # Salaries 데이타을 사용을 위해
    필요한 패키지를 로딩중입니다: car
    Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : 
      네임스페이스 ‘pbkrtest’ 0.4-2는 로드되었으나 >= 0.4.4가 필요합니다
    In addition: Warning message:
    패키지 ‘car’는 R 버전 3.2.5에서 작성되었습니다 
    > library(car)
    Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : 
      네임스페이스 ‘pbkrtest’ 0.4-2는 로드되었으나 >= 0.4.4가 필요합니다
    In addition: Warning message:
    패키지 ‘car’는 R 버전 3.2.5에서 작성되었습니다 
    Error: package or namespace load failed for ‘car’
    > str(Salaries)
    Error in str(Salaries) : object 'Salaries' not found

当我安装r时,汽车包是它已经安装的默认包。我试着下载并加入它。但它仍然得到错误,它无法找到包含在汽车包中的薪水数据集。问题是什么?对不起韩国留言。如果您让我知道用英语更改消息,我将重试并重新上传消息。以下是我的控制台

更新

我用英语更新了此错误消息,并尝试运行评论的错误消息。但它仍然没有用。

> install.packages("car", dependencies=TRUE)
Warning in install.packages :
  dependency ‘pbkrtest’ is not available
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.2/car_2.1-3.zip'
Content type 'application/zip' length 1447199 bytes (1.4 MB)
downloaded 1.4 MB

package ‘car’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
    C:\Windows\Temp\Rtmpgr6B80\downloaded_packages
> library(car)
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
In addition: Warning message:
package ‘car’ was built under R version 3.2.5 
Error: package or namespace load failed for ‘car’
> str(Salaries)
Error in str(Salaries) : object 'Salaries' not found

2 个答案:

答案 0 :(得分:1)

它解决了更新r版本高达3.3.2。 pbkrtest需要r版本超过3.3.2(最新版本)。我更新了r并重新安装了pbkrtest,然后重新安装了汽车包。

答案 1 :(得分:1)

薪水数据集目前在[carData包下],我如下解决了

install.packages("carData")

data("Salaries", package="carData")

sample_n(Salaries,3)
       rank discipline yrs.since.phd yrs.service  sex salary
1      Prof          B            26          19 Male 193000
2 AssocProf          A            13           8 Male  78182
3  AsstProf          B             4           3 Male  91000