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:
-
theme_xx()
functions changed toelement_xx()
theme_segment()
incorporated intotheme_line()
-
opts()
changed totheme()
-
opts(title = "mytitle")
changed tolabs(title = "mytitle")
- 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:
网友评论