Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

warning with R 3.6 #669

Closed
IndrajeetPatil opened this issue Oct 21, 2018 · 26 comments · Fixed by tidyverse/ggplot2#3035
Closed

warning with R 3.6 #669

IndrajeetPatil opened this issue Oct 21, 2018 · 26 comments · Fixed by tidyverse/ggplot2#3035

Comments

@IndrajeetPatil
Copy link

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
@lionel-
Copy link
Member

lionel- commented Oct 21, 2018

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.

@IndrajeetPatil
Copy link
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?

@lionel-
Copy link
Member

lionel- commented Oct 27, 2018

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.

@IndrajeetPatil
Copy link
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()).

@lionel-
Copy link
Member

lionel- commented Oct 27, 2018

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

@IndrajeetPatil
Copy link
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

@lionel-
Copy link
Member

lionel- commented Oct 27, 2018

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.

@IndrajeetPatil
Copy link
Author

Ah, fair point! Thank you very much.

lionel- added a commit to lionel-/ggplot2 that referenced this issue Dec 13, 2018
And depend on rlang >= 0.3.0

Closes r-lib/rlang#669
yutannihilation pushed a commit to tidyverse/ggplot2 that referenced this issue Dec 14, 2018
And depend on rlang >= 0.3.0

Closes r-lib/rlang#669
@lionel- lionel- closed this as completed Dec 17, 2018
@IndrajeetPatil
Copy link
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

@lionel-
Copy link
Member

lionel- commented Apr 11, 2019

They might have released off-branch.

@mjsteinbaugh
Copy link

mjsteinbaugh commented Apr 30, 2019

+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.

@lionel-
Copy link
Member

lionel- commented Apr 30, 2019

This is a ggplot2 issue.

@krlmlr
Copy link
Member

krlmlr commented May 8, 2019

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 .

@GeraldCNelson
Copy link

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

@lionel-
Copy link
Member

lionel- commented May 16, 2019

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

@GeraldCNelson
Copy link

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

@lionel-
Copy link
Member

lionel- commented May 23, 2019

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.

@GeraldCNelson
Copy link

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?

@lionel-
Copy link
Member

lionel- commented May 23, 2019

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.

@GeraldCNelson
Copy link

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?

@lionel-
Copy link
Member

lionel- commented May 23, 2019

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.

@GeraldCNelson
Copy link

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

@Narendra-IITRopar
Copy link

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

@IndrajeetPatil
Copy link
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

@rvlenth
Copy link

rvlenth commented Jul 23, 2019

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.

@lionel-
Copy link
Member

lionel- commented Jul 23, 2019

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.

emitanaka pushed a commit to numbats/learnr that referenced this issue Feb 9, 2022
```
Registered S3 methods overwritten by 'ggplot2':
  method         from 
  [.quosures     rlang
  c.quosures     rlang
  print.quosures rlang
```
r-lib/rlang#669.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants