markdown - add local image file in R presentation -


i'm trying include 1 imaging file (.png) using r markdown r presentation. followed suggestion from: how import local image using knitr markdown using ![title](my.png), error:

error: unexpected '[' in "!["

the my.png file in current path. tried using absolute path got same error message.

putting above inside r chuck failed too.

i 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 working on windows 7 r studio 0.98.1102 , r 3.2.1 .

after huge mount of google search. finanlly figure out problem.

the key html cannot refer local file security reason. except local html file, can refer local file in same file directory.

and r presentation html file webpage.

so, put image file same directory html file, things work. @ least worked me.

just use

![some caption](img_file_name.png)


Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -