how to stop a package message when we load it?

Viewed 42

How can I prevent the --- biotools version 4.0 message produced at the start of each new library(biotools) call?

I have tried the following without success:

suppressPackageStartupMessages(library(biotools))
detach(package:biotools)
suppressStartupMessages(library(biotools))
detach(package:biotools)
suppressMessages(library(biotools))
detach(package:biotools)
suppressWarnings(library(biotools))
1 Answers

An option is to capture the printed version as a string with capture.output and then wrap with invisible. The suppressPackageStartupMessages will prevent the printing of usual messages of attaching other packages/masking of functions (if any) and whatever left over was printed gets captured and removed with invisible

invisible(capture.output(suppressPackageStartupMessages(library(biotools)))) 
Related