title: Plain image in R Markdown PDF output from function `scatter3d` and RGL
body: <p>I am creating a book with <code>bookdown</code> and I have run the <code>scatter3d()</code> function from <code>car</code> and <code>rgl</code>.</p>
  
  <p>I have read that 3D images can be interactivelly implemented in HTML (<a href="http://stla.github.io/stlapblog/posts/rgl_knitr.html" rel="nofollow noreferrer">here</a>), however, what I need is to implement a simply plain image in the PDF output.</p>
  
  <p>How can I do it?</p>
  
  <p>Let's use this example:</p>
  
  <pre><code>scatter3d(mpg~hp+qsec|factor(cyl), data=mtcars, surface=FALSE, residuals=TRUE, 
    parallel=FALSE, bg="white", axis.scales=TRUE, grid=TRUE, ellipsoid=TRUE)
  </code></pre>
  
  <h1>EDIT 1</h1>
  
  <p>By employing @user2554330 's answer, I created an R Markdown file (.Rmd):</p>
  
  <pre><code>---
  title: "Untitled"
  author: "Mario"
  date: "1 July 2019"
  output:
    pdf_document: default
    html_document: default
  ---
  
  ```{r echo=FALSE}
  library(rgl)
  library(car)
  setupKnitr()
  ```
  
  Here's a plot:
  
  ```{r echo=TRUE, dev="png", rgl=TRUE}
  scatter3d(mpg~hp+qsec|factor(cyl), data=mtcars, surface=FALSE, residuals=TRUE,
            parallel=FALSE, bg="white", axis.scales=TRUE, grid=TRUE, ellipsoid=TRUE)    
  ```
  </code></pre>
  
  <p>However, when I convert my .Rmd file to PDF, I do not see the plot:</p>
  
  <p><a href="https://i.stack.imgur.com/t537t.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/t537t.png" alt="enter image description here"></a></p>
  
  <p>Where's the problem?</p>