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:
我正在嘗試使用R markdown為R演示文稿包含一個成像文件(.png)。我按照以下建議:如何使用knitr導入本地圖像進行降價但是使用,我收到此錯誤:
Error: unexpected '[' in "
5
Removing the quotes actually worked for me and note that one better doesn't keep any spaces while naming the image as in use,
刪除引號實際上對我有用,請注意,在使用時命名圖像時,最好不要保留任何空格,

Using quotes or having spaces(when renamed) hasn't worked for me in this case.
在這種情況下,使用引號或有空格(重命名時)對我來說不起作用。
2
If your output format is : slidy_presentation You can use html code:
如果輸出格式為:slidy_presentation您可以使用html代碼:
<img src="/Users/name/folder/xyz.png";>
Further, if you wish to align and adjust the image to a specific side (say right of your final output and specify a size) you can use something like -
此外,如果您希望將圖像對齊並調整到特定的一側(比如最終輸出的右側並指定尺寸),您可以使用類似的東西 -
<img src="/Users/name/folder/xyz.png"; style="max-width:280px;float:right;">
本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2015/08/07/72039e5ce89322813b148db18392f6c.html。