更新包并防止其恢复为原始状态

发布于 2024-08-29 04:53:09 字数 536 浏览 2 评论 0原文

我想升级包ggplot2:

library(ggplot2)
packageDescription("ggplot2")["Version"]
> 0.8.3

但当前版本是0.8.7。

我尝试了 update.packages(),它似乎工作正常。但它仍然返回旧版本0.8.3。

所以我从Cran下载并安装了包源,下载页面上写着0.8.7。 然后我通过 R 中的 GUI 菜单安装它。它返回

** building package indices ...
* DONE (ggplot2)

我然后运行:

packageDescription("ggplot2")["Version"]
> 0.8.3

而且我仍然有旧版本!

我不知道为什么这不起作用,而且我之前已经遇到过这个问题并解决了它(我不记得具体是什么),但现在它又回到了旧版本!保持此类包自动更新并且不让它们引用旧包的最简单方法是什么?

I want to upgrade the package ggplot2:

library(ggplot2)
packageDescription("ggplot2")["Version"]
> 0.8.3

But the current version is 0.8.7.

I tried update.packages(), which seemed to work OK. But it still returned older version 0.8.3.

So I downloaded and installed the package source from Cran, which says 0.8.7 in the download page.
I then install it via the GUI menu in R. It returns

** building package indices ...
* DONE (ggplot2)

I then run:

packageDescription("ggplot2")["Version"]
> 0.8.3

And still I have the older version!

I don't know why this is not working, what's more I had already come across this problem before and solved it (I can't remember exactly what) but now it has gone back to the older version! What's the easiest way to keep packages like this updated automatically and not have them refer back to older packages?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

番薯 2024-09-05 04:53:09

您使用什么版本的 R? CRAN 二进制文件仅针对最新的 R 版本(即 2.10.1)保持最新。如果您有旧版本的 R 并安装了开发工具,则可以使用 install.packages("ggplot2",type="source")。

What version of R are you using? CRAN binaries are only kept up-to-date for the latest R release (i.e. 2.10.1). If you have an older version of R and have the development tools installed, you can use install.packages("ggplot2",type="source").

豆芽 2024-09-05 04:53:09

你做了unloadNamespace('ggplot2')吗?和库(ggplot2)然后检查版本?因为,一旦您加载了一个包,它就会保留在 R 的内存中,即使您可能已经安装了该包的较新版本,R 也看不到,直到您执行上述操作。

Did you do unloadNamespace('ggplot2')? and the library(ggplot2) and then check the version? Because, once you load a package, it stays in memory of R, even though you might have already installed a newer version of the package, R does not see, until you do the above.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文