错误:“ intsvy”的包或名称空间加载失败

时间:2019-12-28 11:33:10

标签: r

我正在使用RStudio版本1.0.136 –©2009-2016 RStudio,Inc.我检查了新的更新,然后收到一个消息,说“您正在使用RStudio的最新版本”。

我在这里尝试使用R'intsvy'软件包。

我从设置目录开始。 然后,首先我使用以下代码安装了该软件包:

install.packages("intsvy", lib="/Library/Frameworks/R.framework/Versions/3.3/Resources/library")

下面是控制台结果

 There is a binary version available but the source version is later:
       binary source needs_compilation
intsvy    2.1    2.4             FALSE

installing the source package ‘intsvy’

trying URL 'https://cran.rstudio.com/src/contrib/intsvy_2.4.tar.gz'
Content type 'application/x-gzip' length 56777 bytes (55 KB)
==================================================
downloaded 55 KB

starting R..
* installing *source* package ‘intsvy’ ...
** package ‘intsvy’ successfully unpacked and MD5 sums checked
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : 
  there is no package called ‘repr’
ERROR: lazy loading failed for package ‘intsvy’
* removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/intsvy’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/intsvy’
Warning in install.packages :
  installation of package ‘intsvy’ had non-zero exit status

The downloaded source packages are in
    ‘/private/var/folders/jj/3brk8hp91ps2mdv6gzlynh6r0000gn/T/RtmppVfRws/downloaded_packages’

第二,在收到以上长时间提示后,我使用以下代码安装了软件包:

install.packages("intsvy")

下面是控制台结果

Installing package into ‘/Users/HU-Hisham/Library/R/3.3/library’
(as ‘lib’ is unspecified)

  There is a binary version available but the source version is later:
       binary source needs_compilation
intsvy    2.1    2.4             FALSE

installing the source package ‘intsvy’

trying URL 'https://cran.rstudio.com/src/contrib/intsvy_2.4.tar.gz'
Content type 'application/x-gzip' length 56777 bytes (55 KB)
==================================================
downloaded 55 KB

starting R..
* installing *source* package ‘intsvy’ ...
** package ‘intsvy’ successfully unpacked and MD5 sums checked
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : 
  there is no package called ‘repr’
ERROR: lazy loading failed for package ‘intsvy’
* removing ‘/Users/HU-Hisham/Library/R/3.3/library/intsvy’
Warning in install.packages :
  installation of package ‘intsvy’ had non-zero exit status

The downloaded source packages are in
    ‘/private/var/folders/jj/3brk8hp91ps2mdv6gzlynh6r0000gn/T/RtmppVfRws/downloaded_packages’

接下来的#load backage

library("intsvy")

下面是我在控制台中收到的按摩

Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : 
  there is no package called ‘repr’
In addition: Warning message:
package ‘intsvy’ was built under R version 3.3.2 
Error: package or namespace load failed for ‘intsvy’

安装后,我尝试运行以下命令

pirls.var.label(folder = getwd("~/Desktop/Dr. Kato/Data/PISA/CY07_MSU_STU_QQQ.sav"),
+                 name = "Variable labels", output = getwd())

这是按摩

Error: could not find function "pirls.var.label"

函数pirls.var.label是'intsvy'软件包中的函数之一。

为什么我会收到此错误?是因为该软件包未成功安装?我该如何处理或开始处理软件包和数据?请指教。

将我的R版本从R3.3.1(2016-06-21)更新到R3.6.2(2019-12-12),如一些专家所建议。

然后我在重新启动R之后再次运行命令:

1个安装repr软件包

> install.packages("repr")
        Warning in install.packages :
      cannot open URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/PACKAGES.rds': HTTP status was '404 Not Found'
    trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/repr_1.0.2.tgz'
    Content type 'application/x-gzip' length 118906 bytes (116 KB)
    ==================================================
    downloaded 116 KB


    The downloaded binary packages are in
        /var/folders/jj/3brk8hp91ps2mdv6gzlynh6r0000gn/T//Rtmpt0mup2/downloaded_packages
    Warning message:
    R graphics engine version 12 is not supported by this version of RStudio. The Plots tab will be disabled until a newer version of RStudio is installed.

2安装intsvy软件包

> install.packages("intsvy", dependencies = T)
trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/intsvy_2.4.tgz'
Content type 'application/x-gzip' length 336356 bytes (328 KB)
==================================================
downloaded 328 KB


The downloaded binary packages are in
    /var/folders/jj/3brk8hp91ps2mdv6gzlynh6r0000gn/T//Rtmpt0mup2/downloaded_packages

负载后退

> library("intsvy")
Error: package or namespace load failed for ‘intsvy’:
 .onLoad failed in loadNamespace() for 'pillar', details:
  call: utils::packageVersion("vctrs")
  error: there is no package called ‘vctrs’
> library(intsvy)
Error: package or namespace load failed for ‘intsvy’:
 .onLoad failed in loadNamespace() for 'pillar', details:
  call: utils::packageVersion("vctrs")
  error: there is no package called ‘vctrs’

当我尝试运行软件包命令时仍然出现相同的错误

> pisa.var.lable(folder="~/Desktop/Dr. Kato/Data/PISA/CY07_MSU_STU_QQQ.sav")
Error in pisa.var.lable(folder = "~/Desktop/Dr. Kato/Data/PISA/CY07_MSU_STU_QQQ.sav") : 
  could not find function "pisa.var.lable"
> pirls.var.label(folder = getwd("~/Desktop/Dr. Kato/Data/PISA/CY07_MSU_STU_QQQ.sav"),
+                 name = "Variable labels", output = getwd())
Error in pirls.var.label(folder = getwd("~/Desktop/Dr. Kato/Data/PISA/CY07_MSU_STU_QQQ.sav"),  : 
  could not find function "pirls.var.label"

如果您有想法,请在这里分享,以便我可以尝试解决此问题并开始使用软件包和PISA数据。

谢谢

0 个答案:

没有答案