版本报错 | Updating ggplot2 code for new version

Ref | Updating ggplot2 code for new version

Since installing the latest version of ggplot2 (0.9.1), I have been getting messages from my old code including:

> 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.

From Winston's github wiki, the key changes are:

  1. theme_xx() functions changed to element_xx()
    theme_segment() incorporated into theme_line()
  2. opts() changed to theme()
  3. opts(title = "mytitle") changed to labs(title = "mytitle")
  4. New features that make programming easier, e.g. ggtitle("mytitle") does the same as #3

Here is a diff of some functions that I updated:

你可能感兴趣的:(版本报错 | Updating ggplot2 code for new version)