R: Packrat 不会完全卸载 [英] R: Packrat will not completely uninstall
问题描述
我之前在 RStudio 中打开了 packrat().我现在希望完全删除和禁用它(即恢复到安装 Packrat 之前的状态).我试图在 Rstudio 中找到一个选项来禁用它,但可以找到任何东西.因此,我通过(在 OSX 10.9.5 上)将 R 和 RStudio 的图标从应用程序文件夹拖到垃圾箱中卸载了 R 和 RStudio.但是,在重新安装 R(版本 3.2.3)后,R 控制台显示以下消息并弹出提示我选择 CRAN 镜像:
I previously turned on packrat() in RStudio. I now wish to completely remove and disable it (i.e. revert to the state prior to installing packrat). I tried to find an option in Rstudio to disable it but could find anything. I therefore uninstalled R and RStudio by (on OSX 10.9.5) dragging the icons for R and RStudio from the applications folder to the trash. However, upon reinstallation of R (version 3.2.3), the R console displayed the following message and a pop-up prompted me to select a CRAN mirror:
Packrat 未安装在本地库中 -- 正在尝试引导安装...本地没有可用的 Packrat 源 tarball--- 请选择在此会话中使用的 CRAN 镜像 ---
Packrat is not installed in the local library -- attempting to bootstrap an installation... No source tarball of packrat available locally --- Please select a CRAN mirror for use in this session ---
所以,我在库中找到了一个名为packrat"的文件夹.删除后,我现在在启动 R 时收到以下信息:
So, I found in Library a folder named 'packrat.' After deleting this, I now receive the following upon starting R:
文件错误(文件名,r",编码 = 编码):
Error in file(filename, "r", encoding = encoding) :
无法打开连接
另外:警告信息:
在文件(文件名,r",编码 = 编码)中:无法打开文件 'packrat/init.R': 没有那个文件或目录
In file(filename, "r", encoding = encoding) : cannot open file 'packrat/init.R': No such file or directory
这与在以下内容中发现的错误相同:packrat 破坏 R 功能的问题 但在 Finder 中搜索时没有找到 .Rprofile 或 .Rhistory 文件,我不知道要手动搜索哪个工作目录.有人可以就如何实施上面链接的解决方案提出建议吗?
This is the same error as found in: Trouble with packrat corrupting R functioning yet no .Rprofile or .Rhistory files are found when I search in Finder and I do not know which working directory to search in manually. Can someone advise on how to implement the solution linked above?
推荐答案
问题确实是 .Rprofile 想要在启动 R 时初始化 packrat().要解决这个问题,请使用以下方法.
The issue was indeed that .Rprofile wanted to initialize packrat() on starting R. To fix this, use the below.
- 打开终端
- 在新命令行上输入:open ~/.Rprofile
- 删除与 packrat 相关的行(这些应该清楚地标记,因为它们包含单词 packrat)
- 保存文件
- 重启 R/Rstudio
这篇关于R: Packrat 不会完全卸载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!