I'm using knitr to generate HTML output of my work while using R.
The problem is, when I include a library, such as
library(car)
my R markdown document includes the warning:
## Warning: package 'car' was built under R version 2.15.3
I have tried these solutions, but none work:
```{r }
invisible(library(car)
and
```{r message = FALSE, warnings = FALSE}
along with
```{r results = 'hide'}
and unfortunately none of these options work.
Further options I've tried, and the actual knitr output follow:
How do I suppress the warning from including a library when using knitr in R?
Thanks in advance.
?suppressWarnings
? – Rich Scrivencar_2.0-19
package? What R version/etc are you running under? – hrbrmstrsuppressWarnings(library(psych))
– Rich Scrivenwarning=FALSE, message=FALSE
eliminates those types of startup messages for me. – Dasonwarnings
, which should bewarning = FALSE
. Also note your R version is unlikely to be 0.98.501, which sounds like an RStudio version. The even better solution is to upgrade R and runupdate.packages()
, so that these warnings just go away (they do not exist for no reason). – Yihui Xie