0 votes
1 view
in R Programming by (5.3k points)

I have a local image that I would like to include in an. Rmd file which I will then knit and convert to HTML slides with Pandoc. Per this post, this will insert the local image :

![Image Title](path/to/your/image)

Is there a way to modify this code to also set the image size?

1 Answer

0 votes
by (25.4k points)

You can read the image using the include_graphics function from the knitr package. The major advantage of using this function is that it is portable in the sense that it works for all document formats that knitr supports, so you do not need to think if you have to use.


```{r, out.width = "400px"} 

knitr::include_graphics("path/to/image.png") ```

For example:

Welcome to Intellipaat Community. Get your technical queries answered by top developers !