Disable messages upon loading a package

后端 未结 5 1961
名媛妹妹
名媛妹妹 2020-11-27 15:49

I have a package in R (ROCR) that I need to load in my R environment. Upon loading the package, a set of messages are printed. This is ordinarily fine, but since the outpu

5条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-27 15:57

    Dirk's answer suppresses all messages and is not specific to messages that is generated while loading packages.

    The more accurate solution to the asked question is:

    suppressPackageStartupMessages(library(THE_PACKAGE_NAME))
    

    A bit more detailed explanation can be found here

提交回复
热议问题