title: add and resize a local image to a .Rmd file in RStudio that will produce a pdf
body: <p>I am trying to add and resize a local image to a <code>.Rmd</code> file in RStudio that will produce a pdf. I can add the file easily with</p>
  
  <p><code>![My caption.](path/file.png)</code></p>
  
  <p>but I have not figured out how to control the size of the image. I tried HTML code with a width attribute, but the image would not appear (I think this only works if outputting to HTML).</p>
  
  <p><code>&lt;img src="path/file.png" width="200px" /&gt;</code></p>
  
  <p>I could not get <a href="https://stackoverflow.com/questions/14675913/how-to-change-image-size-markdown">this idea</a> to work:</p>
  
  <p><code>![My caption.](path/file.png =250x)</code></p>
  
  <p>Is there a way to modify the Rmarkdown script to modify the size of the local image with only RMarkdown and base R?</p>
  
  <p>There is <a href="https://stackoverflow.com/questions/15625990/how-to-set-size-for-local-image-using-knitr-for-markdown">a suggestion</a> to use the <code>png</code> and <code>grid</code> packages, but I am limited to base R for my problem. For other users, however, I think this looks like a good solution.</p>