Updating ggplot2 code for new version

后端 未结 2 1186
轮回少年
轮回少年 2021-01-17 17:01

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\         


        
2条回答
  •  無奈伤痛
    2021-01-17 17:58

    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:

提交回复
热议问题