在Windows中更新R

前端之家收集整理的这篇文章主要介绍了在Windows中更新R前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
this postthis link之后,我试图更新我的R版本.
  1. sessionInfo()
  2. R version 2.14.0 (2011-10-31)
  3. Platform: i386-pc-mingw32/i386 (32-bit)
  4.  
  5. locale:
  6. [1] LC_COLLATE=English_United States.1252
  7. [2] LC_CTYPE=English_United States.1252
  8. [3] LC_MONETARY=English_United States.1252
  9. [4] LC_NUMERIC=C
  10. [5] LC_TIME=English_United States.1252
  11.  
  12. attached base packages:
  13. [1] stats graphics grDevices utils datasets methods base
  14.  
  15. other attached packages:
  16. [1] installr_0.9
  17.  
  18. loaded via a namespace (and not attached):
  19. [1] tools_2.14.0

但是当我运行代码

  1. updateR()
  2. Error in file(con,"r") : cannot open the connection

运行以下命令时,它显示完全相同的错误

  1. check.for.updates.R() # tells you if there is a new version of R or not.
  2. Error in file(con,"r") : cannot open the connection
  3.  
  4. install.R() # download and run the latest R installer
  5. Error in file(con,"r") : cannot open the connection

如何更新我的R版本?

安装程序包的URL可能已过期.只需 go the R website并下载最新版本.

您将不得不手动重新安装您的软件包,这可能是一个痛苦.您可以在旧R中使用rownames(installed.packages())来获取当前安装的软件包的列表,以便当您访问新的R时,您可以将其清除并重新安装.

你甚至可以做

  1. sprintf('install.packages(%s)',paste(shQuote(rownames(installed.packages())),collapse=','))

然后将该命令复制粘贴到您的新R中以尝试重新安装在您的旧R上安装的所有内容.我个人喜欢,只需要安装它们,因为我需要它,所以如果我有包我不再使用在旧的R,除非我需要,否则我不用重新安装它们.

另外,上述可能会失败,只因为您当前的R与新R相比较旧,所以某些软件包可能不再兼容.

猜你在找的Windows相关文章