I'm trying to include one imaging file (.png
) using R markdown for R presentation.
I followed the suggestion from: How to import local image using knitr for markdown
but by using 
, I get this error:
Error: unexpected '[' in "!["
The my.png
file is in current path. I also tried using absolute path but got the same error message.
Putting above inside the r chuck failed too.
I also tried
```{r,fig.width=350, fig.height=250,echo=FALSE}
library(png)
library(grid)
appimg <- readPNG('my.png')
grid.raster(appimg)
```
but failed too!
I am working on windows 7 R studio 0.98.1102 and R 3.2.1 .