更新新版本的ggplot2代码

Abe*_*Abe 8 r ggplot2

自从安装最新版本的ggplot2(0.9.1)以来,我一直从旧代码中获取消息,包括:

> warnings()
Warning messages:
1: 'opts' is deprecated.
Use 'theme' instead.
See help("Deprecated")
2: 'theme_text' is deprecated.
Use 'element_text' instead.
See help("Deprecated")
8: In opts(title = trait axis.text.x = theme_text(size = fontsize$axis),  ... :
  Setting the plot title with opts(title="...") is deprecated. Use labs(title="...") or ggtitle("...") instead.
9: 'opts' is deprecated.
Run Code Online (Sandbox Code Playgroud)

我有几个问题:

  1. 帮助("贬值")返回"no documentation for 'Depreciated' in specified packages and libraries"; 这是一个错误吗?
  2. 是否有一段时间'Depreciated'会转向'过时'并且我的代码会开始抛出错误?
  3. 如何更新我的代码(解决这些特定问题并阻止其他人等待找到)?
  4. 我可以加载两个版本的ggplot2并指定我正在使用的每个函数的哪个版本?
  5. 什么时间尺度可能更新语法变得过时?

我接受这是软件的一个常见问题,但也许SO的一些贡献者对包的作者的长期计划和基本原理有具体的了解.

Dav*_*uer 15

来自Winston的github wiki,主要变化是:

  1. theme_xx() 功能改为 element_xx()

    theme_segment() 纳入 theme_line()

  2. opts() 变成 theme()
  3. opts(title = "mytitle") 变成 labs(title = "mytitle")
  4. 使编程更容易的新功能,例如ggtitle("mytitle")与#3相同

这是我更新的一些函数差异:


jor*_*ran 9

对于其中的许多内容,我将开始关注ggplot2-dev邮件列表和/或包github存储库.

你没有找到任何东西的原因只是因为你拼错了"弃用".

有关升级代码的信息,请参阅此转换指南指南.我的理解是,弃用是彻底删除的第一步,通常会在下一个"主要"版本中发生.由于0.9.2刚刚问世,我猜测下一个至少需要6-8个月,但这只是猜测.

这是可能加载不同版本的软件包.

(小点:最新版本是0.9.2.1!)