[Rd] require(..., quietly=TRUE) does not suppress warning

Dan Tenenbaum dtenenba at fredhutch.org
Thu Dec 8 20:43:02 CET 2016


Hi,

The `quietly` argument of `require` is documented as follows:

 quietly: a logical.  If ‘TRUE’, no message confirming package
          attaching is printed, and most often, no errors/warnings are
          printed if package attaching fails.

However:

> require(foo, quietly=TRUE)
Warning message:
In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
  there is no package called ‘foo’

Am I misreading the docs or is R misbehaving?

> sessionInfo()
R version 3.3.2 (2016-10-31)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: macOS Sierra 10.12.1

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

Dan



More information about the R-devel mailing list