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)
有没有办法修改此代码来设置图像大小?
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)
有没有办法修改此代码来设置图像大小?
例如,你也可以使用png
软件包读取图像,并使用grid
软件包中的grid.raster
进行常规绘图.
```{r fig.width=1, fig.height=10,echo=FALSE}
library(png)
library(grid)
img <- readPNG("path/to/your/image")
grid.raster(img)
```
使用这种方法,您可以完全控制图像的大小.