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.
I have a few questions:
"no documentation for 'Depreciated' in specified packages and libraries"
; is this an error?I accept that this is a common issue with software, but perhaps some contributors to SO have specific insight into the longer term plans and rationale of the package's author.
Recent versions of R (version 3.2 or newer) and RStudio (version 0.99 or above) are required.
Check your current version of R and ggplot2 2 and the current version of ggplot is ggplot2_0. 9.3 (found under 'other attached packages'). If both R and ggplot2 are old, first install the current version of R and then update your packages.
You may notice that we sometimes reference 'ggplot2' and sometimes 'ggplot'. To clarify, 'ggplot2' is the name of the most recent version of the package. However, any time we call the function itself, it's just called 'ggplot'.
Installing ggplot2 The ggplot2 package can be easily installed using the R function install. packages() . The above code will automatically download the ggplot2 package, from the CRAN (Comprehensive R Archive Network) repository, and install it.
From Winston's github wiki, the key changes are:
theme_xx()
functions changed to element_xx()
theme_segment()
incorporated into theme_line()
opts()
changed to theme()
opts(title = "mytitle")
changed to labs(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:
For many of these things, I'd start following the ggplot2-dev mailing list, and/or the packages github repository.
The reason you were not finding anything was simply because you had misspelled "deprecated".
For upgrading your code, see this transition guide or this one. My understanding is that deprecation is the first step in total removal, which would typically happen in the next "major" release. Since 0.9.2 just came out, I'd guess the next one is at least 6-8 months away, but that's just a guess.
It is possible to load different versions of a package.
(Minor point: the latest version is 0.9.2.1!)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With