Closed wlandau closed 3 years ago
Is this not the same as a) using one many ways in knitr to suppress console output and/or b) doing what I do most of the time, wrapping suppressMessages(...)
around one or more library(calls)
.
I was able to confirm that I did get the message (as you state) when not wrapped, but no longer see it once I wrap:
But I may well have misunderstood your issue or question.
I think this might be an RStudio issue (see https://github.com/rstudio/rstudio/issues/9692). If you turn off diagnostics does that stop the problem? If it does would you mind giving a plus one on that issue and linking this.
@TimTaylor, the message persists after I uncheck everything in global options -> code -> diagnostics. Likewise after I uncheck everything in global options -> code -> completion. But I went ahead and dropped a comment and thumbs up in that RStudio issue.
@eddelbuettel, the message does not bother me as a user, but it pops up for everyone using targets
because of the dependency on data.table
. I am starting to repeat myself when targets
users ask me about it.
@wlandau There is nothing (AFAIK) that 'team data.table' can do for you here. That is base R, end of story.
You could recommend the following to your users which shadows how other people load dplyr
where R also (rightly, I may add) yells at them for duplicated symbols:
@eddelbuettel I think you are right that this is not for 'team data.table' but it is not what base R is doing that is the issue rather it is something Rstudio is doing .... to clarify if you take @wlandau's example Rmd and replace the call with library(data.table)
you will get the same message which is somewhat cyclic:
Registered S3 method overwritten by 'data.table':
method from
print.data.table
@wlandau you can stop it happening by setting Chunk Output in Console
-
Closing since this turned out to not be a data.table
issue. Thanks for the input.
@TimTaylor I said so myself in https://github.com/Rdatatable/data.table/issues/5103#issuecomment-902371906 (see 1st and 2nd par). The issue has zero to do with RStudio.
@eddelbuettel - we may have crossed wires but at least there is one less issue open. Perhaps semantics but I still think it is due to RStudio (but certainly could be wrong) as they override some s3 methods; see https://github.com/rstudio/rstudio/blob/edbc775214e1a46edd145ca6d37e14e2cded86e6/src/cpp/session/modules/NotebookData.R and https://github.com/rstudio/rstudio/pull/2762/files
@TimTaylor If you go back and read what I wrote then you may agree that it boils down to a) me saying you can suppress library loading noise by wrapping in suppressMessages()
, and b) me saying you can suppress library noise by add adding warn.conflicts=FALSE
(as well as c) telling knitr to be quiet, which is yet another layer). Neither has anything to with RStudio. (They may be at fault for tickling noise relative to dtplyr
; that is outside of my realm as I d) mostly run R outside of RStudio and e) do not use that package all that much, and hence f) almost surely not inside RStudio.)
I.e. 'a page full of noise' on the left with plain library()
calls, two quiet lines on the right.
I chimed in here in an attempt to be helpful to Will when nobody had yet answered his question. It was not my intend to upset or confuse you. If I have done so, my bad. Base R still works as instrumented when used as designed. That's really all I was trying to reaffirm. Peace out, and one issue down as you say.
@eddelbuettel Zero upset or confusion caused - we are just looking at the issue differently. Enjoy the weekend.
Sorry for posting an issue without content initially. I accidentally hit the wrong keystroke.
When I load
data.table
through the R console, I see the usual messages about threads etc., which is fine. But when I start a new session and loaddata.table
through the R Markdown notebook interface in the RStudio IDE:I also see a message I would like to get rid of:
This message also appears if I restart R and load a package that imports
data.table
functions, such asdtplyr
ortargets
. The unwanted S3 method message do not appear if I knit the notebook from end to end instead of clicking the right-hand green play button in the notebook interface.Minimal reproducible example
Please see above.
Output of
sessionInfo()