我在磁盘上有一张图片,并希望在R Jupyter笔记本的markdown单元格中显示它。我该怎么做?
我知道用Python很简单,只需要从display导入Image类即可。
我知道用Python很简单,只需要从display导入Image类即可。
IRdisplay具有用于丰富显示“内容”的功能,其中包括图像:
library("IRdisplay")
display_png(file="plot.png)
<img src="../relative/path/to/img.png">
![image](../relative/path/to/img.png)
![image](../relative/path/to/img.png)
,但这只是个人口味问题。 - celimage_chosen = choose.files(
default = "",
caption = "Select The Image File (in PNG format) to Insert",
multi = TRUE, filters = Filters,
index = nrow(Filters)
)
chosen_image_name = basename(image_chosen)
#chosen_image_name # uncomment this line to show the location of the image.
IRdisplay::display_png(file = chosen_image_name) # This line inserts the image.