Ggplot2 code update for new version

Since installing the latest version of ggplot2 (0.9.1), I get 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. 

I have a few questions:

  • help ("Amortized") returns "no documentation for 'Depreciated' in specified packages and libraries" ; this is mistake?
  • Is there some time when Amortized switches to Deprecated and my code starts to generate errors?
  • How can I update my code (to solve these specific problems and prevent other pending expectations)?
  • Can I download two versions of ggplot2 and indicate which version of each function I use?
  • At what timeline does the updated syntax become obsolete?

I agree that this is a common software problem, but perhaps some SO contributors have a concrete understanding of the long-term plans and rationale for the author of the package.

+6
source share
2 answers

For many of these things, I would start using the ggplot2-dev mailing list and / or github repository packages.

The reason you didn't find anything was simply because you mistakenly wrote "out of date."

To update the code, see this migration guide or this one . My understanding is that failure is the first step in a general removal, which usually happens in the next "main" version. Since 0.9.2 has just been released, I assume the next one will be at least 6-8 months old, but this is just an assumption.

It is possible to download various versions of the package.

(Minor point: the latest version is 0.9.2.1!)

+9
source

From the Winston github wiki key changes:

  • theme_xx() functions changed to element_xx()

    theme_segment() included in theme_line()

  • opts() changed to theme()
  • opts(title = "mytitle") changed to labs(title = "mytitle")
  • New features that make programming easier, for example. ggtitle("mytitle") does the same as # 3

Here is the diff of some of the features that I updated:

+11
source