首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ggplotly无法工作或重新安装-有办法卸载它吗?

ggplotly无法工作或重新安装-有办法卸载它吗?
EN

Stack Overflow用户
提问于 2017-03-06 04:40:35
回答 1查看 224关注 0票数 1

我有一个问题,我认为我可能能够解决我的,如果我可以卸载'ggplotly‘之前,试图重新安装它。

下面是所发生的事情:

当老师演示它的时候,代码工作得很好,但是当我在家里尝试的时候却失败了。是。通过逐行研究问题代码单元,问题的中心是ggplot2 (它使用ggplotly)。下面提供了代码和错误消息。在代码中,“图”是一个应该传递到ggplot2 facet_wrap()中的ggplotly

下面是我的控制台中关于这个问题的摘录,以及通过重新安装来修复它的失败尝试:

代码语言:javascript
复制
> ggplotly(graph)
Error in dev_fun(tmpPlotFile, width = deviceWidth, height = deviceHeight) : 
  unable to start png() device
> ggplotly(graph)
Error in RStudioGD() : 
  Shadow graphics device error: r error 4 (R code execution error)
In addition: Warning messages:
1: In grDevices:::png("C:/Users/User/AppData/Local/Temp/Rtmp0ar20f/3b613ba7d0ce4228bc937aee7cfcb112.png",  :
  unable to open file 'C:/Users/User/AppData/Local/Temp/Rtmp0ar20f/3b613ba7d0ce4228bc937aee7cfcb112.png' for writing
2: In grDevices:::png("C:/Users/User/AppData/Local/Temp/Rtmp0ar20f/3b613ba7d0ce4228bc937aee7cfcb112.png",  :
  opening device failed
> install.packages("plotly")
Error in install.packages : Updating loaded packages
Error in gzfile(file, mode) : cannot open the connection
In addition: Warning message:
In gzfile(file, mode) :
  cannot open compressed file 'C:\Users\User\AppData\Local\Temp\Rtmp0ar20f/libloc_190_4464fd2b.rds', probable reason 'No such file or directory
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-03-06 17:03:23

根据这个线程上的注释,可以用remove.packages卸载一个包。根据这篇文章最初的问题,去安装和重新安装清除了它,但为了完整起见,以下是我为提高这一工作机会所采取的所有预防措施:

  1. 按指示移除包装
  2. 重新初始化RStudio (退出而不保存工作区并重新输入)
  3. 默认情况下,它会记住我的一些环境,所以我点击了扫帚图标来清除内存中的所有变量和数据。
  4. 重新安装软件包
  5. 重新加载原始R文件并进行测试,以确保所有文件都按预期工作。

这是我在控制台中看到的,与原始帖子中显示的消息形成对比的是,卸载和重新安装:

在去安装期间:

代码语言:javascript
复制
> remove.packages("plotly")
Removing package from ‘C:/ProgramFilesCoders/R/R-3.3.2/library’
(as ‘lib’ is unspecified)
Error in gzfile(file, mode) : cannot open the connection
In addition: Warning message:
In gzfile(file, mode) :
  cannot open compressed file 'C:\Users\User\AppData\Local\Temp\Rtmp0ar20f/libloc_190_4464fd2b.rds', probable reason 'No such file or directory'

在重新安装期间:

代码语言:javascript
复制
> install.packages("plotly")
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/plotly_4.5.6.zip'
Content type 'application/zip' length 817502 bytes (798 KB)
downloaded 798 KB

package ‘plotly’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
    C:\Users\User\AppData\Local\Temp\RtmpGco6OK\downloaded_packages 
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42617659

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档