I\'m loading optmatch
in a Sweave document as follows:
<>=
library(optmatch, quietly=TRUE)
@
You\'re loadi
Here is an R solution to your problem. The package author uses cat
to print the messages to the console, rather than using standard message statements. You can intercept these messages by using sink
to divert console output to a temporary file:
<<myCodeBlock, echo=FALSE>>=
zz <- tempfile()
sink(file=zz)
library(optmatch, quietly=TRUE))
unlink(zz)
@
PS. The solution by @XuWang
uses only SWeave, so is clearly much more suitable in your case.
Try loading the package in a hide results chunk:
<<packages,results=hide>>=
require(optmatch)
@
If you use the knitr
package, you need to quote hide:
<<packages,results='hide'>>=
require(optmatch)
@