找不到对象"pkgInfo",r [英] object 'pkgInfo' not found, r

查看:44
本文介绍了找不到对象"pkgInfo",r的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试运行一个在过去几天中运行良好的脚本,但是最近让我感到非常沮丧.

I'm trying to run a script that worked well in the past few days, but has been causing me much grief recently.

当我尝试加载插入符号库时,它表示ggplot2存在问题.这是输出:

When I try to load the caret library, it says that there is a problem with ggplot2. Here is the output:

> library(caret)
Loading required package: lattice
Loading required package: ggplot2
Error: package or namespace load failed for ‘ggplot2’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
 object 'pkgInfo' not found
Error: package ‘ggplot2’ could not be loaded

我不知道pkgInfo是什么.该问题的其他StackOverflow问题答案是,由于代码中未使用引号,导致R认为它正在寻找名为pkgInfo的对象.但是在这种情况下,错误来自内部...

I have no clue what pkgInfo is. Other StackOverflow questions answers to this problem are that that's from not using quotes in your code making R think that it's looking for an object named pkgInfo. But in this case, the error is coming from inside...

... ggplot2的源代码.(也许,我不知道,这不是我的代码直接导致我知道的错误)我运行了 install.packages("ggplot",dep = TRUE)并暂时解决了该问题,但我需要更长的解决方案.我敢肯定,我昨天尝试过该方法,但今天仍然需要修复它.我还想解释一下你们是否可以提供,以便将来防止这种情况发生.谢谢!

...the source code of ggplot2. (maybe, I don't know, it's not my code directly causing the error I know) I've ran install.packages("ggplot", dep = TRUE) and it fixed the problem for now, but I want a longer solution. I'm pretty sure I tried that yesterday and left me to still need to fix it today. I'd also like an explanation if y'all can provide so I can prevent this in the future. Thanks!

> sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] lattice_0.20-35

loaded via a namespace (and not attached):
 [1] compiler_3.5.1  backports_1.1.2 magrittr_1.5    rprojroot_1.3-2 htmltools_0.3.6 tools_3.5.1     yaml_2.2.0     
 [8] Rcpp_0.12.18    stringi_1.1.7   rmarkdown_1.10  grid_3.5.1      knitr_1.20      stringr_1.3.1   digest_0.6.15  
[15] evaluate_0.11  

推荐答案

对于发布误导性信息(红色鲱鱼),我感到抱歉.

I am sorry for posting misleading info, a red herring.

R的工作目录位于文档"文件夹中.我的文档文件夹已同步到我的Google驱动器,几天前我注意到Google驱动器工作非常辛苦,在后台占用了一些资源.我看到它尝试同步的许多文件都在R的win-library目录中.我不知道如何真正停止同步子目录,所以从我的google驱动器中删除了该目录,希望它不再混乱我在笔记本电脑上的R.

My working directory for R is in my Documents folder. My Documents folder is synced to my google drive, and I noticed a few days ago that google drive was working very hard, sucking up some resources in the background. I saw that a lot of the files it was trying to sync was in the win-library directory for R. I, not knowing how to truly stop the syncing of a subdirectory, deleted the directory from my google drive expecting it to stop messing with my R on my laptop.

相反,Google开始更多地处理我的R文件.现在,我已停止将我的Documents文件夹与Google云端硬盘同步,一切运行顺利.

Instead, Google started messing with my R files even more. Now that I've stopped syncing my Documents folder with Google Drive, everything is running smoothly.

这篇关于找不到对象"pkgInfo",r的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆