How to suppress dev.off() messages in knitr chunk options with markdown in R

Viewed 2157

I have a chunk of code I don't want to split up in my .rmd file that I'm knitting in RStudio.

My global options are:

{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, autodep = T, message = FALSE, warnings = FALSE, cache=TRUE, messages=FALSE)

Even my chunk option is:

{r section025, message=FALSE, warning=FALSE}
code here

And the PDF output shows the following in the middle of the page where I have saved an image out in my code:

## pdf 
## 2

I seem to have used all the suppression options, so I cannot figure out why this still appears. Thoughts appreciated.

2 Answers

send the result of dev.off() to a garbage variable

whatever <- dev.off()
Related