Skip to content

warning with R 3.6 #669

Closed
tidyverse/ggplot2
#3035

Description

@IndrajeetPatil

With the development version of R 3.6 I am getting the following warning once per session. Is this expected? Wasn't getting any such warning with 3.5, so just wanted to raise this issue before the next release.

Registered S3 methods overwritten by 'ggplot2':
  method         from 
  [.quosures     rlang
  c.quosures     rlang
  print.quosures rlang

Activity

  1. lionel- commented on Oct 21, 2018

    @lionel-
    Member

    Ah, interesting, thanks! We just need to remove those methods from ggplot2 once rlang 0.3.0 is on CRAN.

    @hadley Seems like overwriting S3 methods has finally become verbose.

  2. IndrajeetPatil commented on Oct 27, 2018

    @IndrajeetPatil
    Author

    Until this is implemented, what can I do so that my package won't clutter the terminal with all these messages (I am getting similar things from dplyr, skimr, etc.) when it is loaded?

  3. lionel- commented on Oct 27, 2018

    @lionel-
    Member

    What similar thing are you getting from dplyr?

    This is not high priority because R 3.6 is still a long ways from being released.

  4. IndrajeetPatil commented on Oct 27, 2018

    @IndrajeetPatil
    Author

    For dplyr, I am getting:

    Registered S3 method overwritten by 'dplyr':
      method               from  
      as.data.frame.tbl_df tibble
    

    Completely understandable that this is not a high priority. But I'd still like to not have these messages on my local system with 3.6.0 because they also appear in vignettes, etc. That's why I was asking if there is any temporary workaround to this (like suppressPackageStartupMessages()).

  5. lionel- commented on Oct 27, 2018

    @lionel-
    Member

    These are messages so you can use suppressMessages() to muffle them.

  6. IndrajeetPatil commented on Oct 27, 2018

    @IndrajeetPatil
    Author

    But in the context of a package where can I add suppressMessage()?

    So, for example, this is what I get with devtools::check(), and this is what the user going to see as well when they do library(ggstatsplot)-

    ==> devtools::check(args = c('--as-cran'))
    
    Updating ggstatsplot documentation
    Writing NAMESPACE
    Loading ggstatsplot
    Registered S3 method overwritten by 'dplyr':
      method               from  
      as.data.frame.tbl_df tibble
    Registered S3 methods overwritten by 'broom.mixed':
      method         from 
      augment.lme    broom
      augment.merMod broom
      glance.lme     broom
      glance.merMod  broom
      glance.stanreg broom
      tidy.brmsfit   broom
      tidy.gamlss    broom
      tidy.lme       broom
      tidy.merMod    broom
      tidy.rjags     broom
      tidy.stanfit   broom
      tidy.stanreg   broom
    Registered S3 methods overwritten by 'ggplot2':
      method         from 
      [.quosures     rlang
      c.quosures     rlang
      print.quosures rlang
    Registered S3 method overwritten by 'skimr':
      method      from  
      print.spark pillar
    Writing NAMESPACE
    
  7. lionel- commented on Oct 27, 2018

    @lionel-
    Member

    You can use it like this: suppressMessages(library("mypkg")) (though note the messages are triggered on load, not attach, so the suppressMessages might have to be used earlier or might not be practical).

    Your users are not going to see the messages because we'll fix them before R 3.6 is out.

  8. IndrajeetPatil commented on Oct 27, 2018

    @IndrajeetPatil
    Author

    Ah, fair point! Thank you very much.

  9. added a commit that references this issue on Dec 13, 2018
    d6db4b1
  10. added a commit that references this issue on Dec 14, 2018
    9292832
  11. IndrajeetPatil commented on Apr 10, 2019

    @IndrajeetPatil
    Author

    Since the release of ggplot2 3.1.1 I am getting these warnings again. Did something change in the new release?

    library(rlang)
    library(ggplot2)
    #> Registered S3 methods overwritten by 'ggplot2':
    #>   method         from 
    #>   [.quosures     rlang
    #>   c.quosures     rlang
    #>   print.quosures rlang

    Created on 2019-04-10 by the reprex package (v0.2.1.9000)

    Session info
    devtools::session_info()
    #> - Session info ----------------------------------------------------------
    #>  setting  value                                    
    #>  version  R version 3.6.0 alpha (2019-03-29 r76300)
    #>  os       Windows 10 x64                           
    #>  system   x86_64, mingw32                          
    #>  ui       RTerm                                    
    #>  language (EN)                                     
    #>  collate  English_United States.1252               
    #>  ctype    English_United States.1252               
    #>  tz       America/New_York                         
    #>  date     2019-04-10                               
    #> 
    #> - Packages --------------------------------------------------------------
    #>  package     * version    date       lib
    #>  assertthat    0.2.1      2019-03-21 [1]
    #>  backports     1.1.4      2019-04-10 [1]
    #>  callr         3.2.0      2019-03-15 [1]
    #>  cli           1.1.0      2019-03-19 [1]
    #>  colorspace    1.4-1      2019-03-18 [1]
    #>  crayon        1.3.4      2017-09-16 [1]
    #>  desc          1.2.0      2019-04-03 [1]
    #>  devtools      2.0.2      2019-04-08 [1]
    #>  digest        0.6.18     2018-10-10 [1]
    #>  dplyr         0.8.0.9009 2019-03-15 [1]
    #>  evaluate      0.13       2019-02-12 [1]
    #>  fs            1.2.7      2019-03-19 [1]
    #>  ggplot2     * 3.1.1      2019-04-07 [1]
    #>  glue          1.3.1      2019-03-12 [1]
    #>  gtable        0.3.0      2019-03-25 [1]
    #>  highr         0.8        2019-03-20 [1]
    #>  htmltools     0.3.6      2017-04-28 [1]
    #>  knitr         1.22.8     2019-04-08 [1]
    #>  lazyeval      0.2.2      2019-03-15 [1]
    #>  magrittr      1.5        2014-11-22 [1]
    #>  memoise       1.1.0      2017-04-21 [1]
    #>  munsell       0.5.0      2018-06-12 [1]
    #>  pillar        1.3.1      2018-12-15 [1]
    #>  pkgbuild      1.0.3      2019-03-20 [1]
    #>  pkgconfig     2.0.2      2018-08-16 [1]
    #>  pkgload       1.0.2      2018-10-29 [1]
    #>  plyr          1.8.4      2016-06-08 [1]
    #>  prettyunits   1.0.2      2015-07-13 [1]
    #>  processx      3.3.0      2019-03-10 [1]
    #>  ps            1.3.0      2018-12-21 [1]
    #>  purrr         0.3.2      2019-03-15 [1]
    #>  R6            2.4.0      2019-02-14 [1]
    #>  Rcpp          1.0.1      2019-03-17 [1]
    #>  remotes       2.0.4      2019-04-10 [1]
    #>  rlang       * 0.3.4      2019-04-07 [1]
    #>  rmarkdown     1.12.3     2019-03-25 [1]
    #>  rprojroot     1.3-2      2018-01-03 [1]
    #>  scales        1.0.0      2018-08-09 [1]
    #>  sessioninfo   1.1.1      2018-11-05 [1]
    #>  stringi       1.4.3      2019-03-12 [1]
    #>  stringr       1.4.0      2019-02-10 [1]
    #>  testthat      2.0.1      2018-10-13 [1]
    #>  tibble        2.1.1      2019-03-16 [1]
    #>  tidyselect    0.2.5      2018-10-11 [1]
    #>  usethis       1.5.0      2019-04-07 [1]
    #>  withr         2.1.2      2018-03-15 [1]
    #>  xfun          0.6        2019-04-02 [1]
    #>  yaml          2.2.0      2018-07-25 [1]
    #>  source                            
    #>  CRAN (R 3.6.0)                    
    #>  CRAN (R 3.6.0)                    
    #>  CRAN (R 3.6.0)                    
    #>  CRAN (R 3.6.0)                    
    #>  CRAN (R 3.6.0)                    
    #>  CRAN (R 3.5.1)                    
    #>  Github (r-lib/desc@c860e7b)       
    #>  CRAN (R 3.6.0)                    
    #>  CRAN (R 3.5.1)                    
    #>  Github (tidyverse/dplyr@df735d1)  
    #>  CRAN (R 3.6.0)                    
    #>  CRAN (R 3.6.0)                    
    #>  CRAN (R 3.6.0)                    
    #>  CRAN (R 3.6.0)                    
    #>  CRAN (R 3.6.0)                    
    #>  CRAN (R 3.6.0)                    
    #>  CRAN (R 3.5.1)                    
    #>  Github (yihui/knitr@6103edd)      
    #>  CRAN (R 3.6.0)                    
    #>  CRAN (R 3.5.1)                    
    #>  CRAN (R 3.5.1)                    
    #>  CRAN (R 3.5.1)                    
    #>  CRAN (R 3.6.0)                    
    #>  CRAN (R 3.6.0)                    
    #>  CRAN (R 3.5.1)                    
    #>  CRAN (R 3.6.0)                    
    #>  CRAN (R 3.5.1)                    
    #>  CRAN (R 3.5.1)                    
    #>  CRAN (R 3.6.0)                    
    #>  CRAN (R 3.6.0)                    
    #>  CRAN (R 3.6.0)                    
    #>  CRAN (R 3.6.0)                    
    #>  CRAN (R 3.6.0)                    
    #>  CRAN (R 3.6.0)                    
    #>  CRAN (R 3.5.3)                    
    #>  Github (rstudio/rmarkdown@503cc5f)
    #>  CRAN (R 3.5.1)                    
    #>  CRAN (R 3.5.1)                    
    #>  CRAN (R 3.6.0)                    
    #>  CRAN (R 3.6.0)                    
    #>  CRAN (R 3.6.0)                    
    #>  CRAN (R 3.5.1)                    
    #>  CRAN (R 3.6.0)                    
    #>  CRAN (R 3.5.1)                    
    #>  CRAN (R 3.6.0)                    
    #>  CRAN (R 3.5.1)                    
    #>  CRAN (R 3.6.0)                    
    #>  CRAN (R 3.5.1)                    
    #> 
    #> [1] C:/Users/inp099/Documents/R/win-library/3.6
    #> [2] C:/Program Files/R/R-3.6.0alpha/library
  12. lionel- commented on Apr 11, 2019

    @lionel-
    Member

    They might have released off-branch.

  13. mjsteinbaugh commented on Apr 30, 2019

    @mjsteinbaugh

    +1 that I'm seeing these messages pop up again on R 3.6.
    I have ggplot2 3.3.1 and rlang 0.3.4 installed.

  14. lionel- commented on Apr 30, 2019

    @lionel-
    Member

    This is a ggplot2 issue.

  15. krlmlr commented on May 8, 2019

    @krlmlr
    Member

    Not a solution, but still perhaps helpful: the messages can be muted by setting the _R_S3_METHOD_REGISTRATION_NOTE_OVERWRITES_ environment variable to 0: https://github.com/wch/r-source/blob/2caeaf151293da51c38ccc65ff3b02171726a958/src/library/base/R/namespace.R#L1694 .

  16. GeraldCNelson commented on May 16, 2019

    @GeraldCNelson

    I'm getting similar messages with mailR when I run library(mailR). mailR version is 0.6 The details are
    Registered S3 method overwritten by 'R.oo':
    method from
    throw.default R.methodsS3

  17. lionel- commented on May 16, 2019

    @lionel-
    Member

    @GeraldCNelson This is purely between the R.oo and R.methodsS3 packages.

  18. GeraldCNelson commented on May 23, 2019

    @GeraldCNelson

    This may be true for this particular example with R.oo and R.methodsS3, but it seems like most of the packages I run now have this same message. Here's one for Rselenium.

    library(RSelenium)
    Registered S3 method overwritten by 'openssl':
      method      from
      print.bytes Rcpp
    
  19. lionel- commented on May 23, 2019

    @lionel-
    Member

    This is because these packages don't prefix their class with the package name (e.g. "Rcpp_bytes") so there are collisions when they register methods for third party generics like print().

    If we were writing rlang now, we'd use "rlang_quosure" instead of just "quosure" to avoid this kind of issues.

  20. GeraldCNelson commented on May 23, 2019

    @GeraldCNelson

    What process should we (I) follow to get rid of these?

    1. live with it?
    2. request package authors to prefix their class with the package name?
    3. Something else?

    Is there any way to send out a message to all the relevant authors to revise their packages as you suggested?

  21. lionel- commented on May 23, 2019

    @lionel-
    Member

    2 would be ideal but this might be a highly breaking change as all methods written by downstream packages will need to be renamed as well.

  22. GeraldCNelson commented on May 23, 2019

    @GeraldCNelson

    Is this something that could be fixed in R3.6.1. It seems like the change that created these messages was made in R3.6. I suppose though that the messages will prompt enough issue reports to authors that they will make the changes. Can you suggest some language to put in an issue report on GitHub for those of us who don't really understand the problem?

  23. lionel- commented on May 23, 2019

    @lionel-
    Member

    There were always collisions, they just were silent. So I don't think R should remove the message.

    I would say something like this:

    It seems the class "foo" of your package is conflicting with the same class "foo" of package {bar}, at least for methods baz() and quux(). Since S3 classes are not namespaced, manual namespacing is required to avoid this sort of collisions. Would there be any chance either of you could rename your class to use your package name as a prefix? It probably makes sense to do this renaming in the package with the fewest reverse dependencies, to minimise breakages.

  24. GeraldCNelson commented on May 23, 2019

    @GeraldCNelson

    I figured that was the case. Thanks for the text to nudge package authors with!

  25. Narendra-IITRopar commented on Jul 2, 2019

    @Narendra-IITRopar

    I am getting a similar message with ez on R 3.6.0

    Registered S3 methods overwritten by 'lme4': method from cooks.distance.influence.merMod car influence.merMod car dfbeta.influence.merMod car dfbetas.influence.merMod car

  26. IndrajeetPatil commented on Jul 2, 2019

    @IndrajeetPatil
    Author

    This has nothing to do with rlang and everything to do with lme4.

    There is already issue at lmr4 repo about this:
    lme4/lme4#510

  27. rvlenth commented on Jul 23, 2019

    @rvlenth

    I have noted that if I have the code

    if (requireNamespace("ggplot2", quietly = TRUE)) {
        ...
    }

    then the messages shown in the first comment on this thread appear. However, quietly = TRUE is supposed to suppress all progress and error messages, according to the documentation. It seems to me that S3 method overwrites should also be quieted.

  28. lionel- commented on Jul 23, 2019

    @lionel-
    Member

    quietly should only quiet messages intended for the user and providing information about normal behaviour. This is not the case here, the behaviour is faulty and the message is intended for developers. It shouldn't be suppressed.

  29. added a commit that references this issue on Feb 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions