How to suppress warning messages when loading a library?

后端 未结 2 889
再見小時候
再見小時候 2020-12-29 19:16

I\'m trying to run a r script from the command line, but I get warning messages when packages are loaded:

C:\\Temp>Rscript myscript.r param
Warning messag         


        
2条回答
  •  遥遥无期
    2020-12-29 19:42

    These are not messages but warnings. You can do:

    suppressWarnings(library(RODBC))
    

    or

    suppressWarnings(suppressMessages(library(RODBC)))
    

    to suppress both types.

提交回复
热议问题