suppressPackageStartupMessages(library(fields))
And you can still test the result of the `library` or `require` calls:
a = suppressPackageStartupMessages(require(fields))
Variable ‘a’ will be TRUE if it was successful, FALSE otherwise.
suppressPackageStartupMessages(library(fields))
And you can still test the result of the `library` or `require` calls:
a = suppressPackageStartupMessages(require(fields))
Variable ‘a’ will be TRUE if it was successful, FALSE otherwise.
suppressPackageStartupMessages(library(lattice)) does not work within knitr. Any idea why ?
Hey Rajaraman.
Thx for the comment. Have not really used knitr in the past but reading the documentation in http://cran.r-project.org/web/packages/knitr/index.html I noticed that it said that warnings and errors are written by default, but can be turned off.
I guess that if you want to turn the warnings off, you need to find out how to do it from within knitr which probably overrides suppressPackageStartupMessages.