将我的推特帐户中的图片带到 Rmarkdown

Bring an image from my twitter account to Rmarkdown

我想在我正在编写的 RMarkdown 文档中插入我的推特帐户个人资料照片,但是它根本没有显示任何输出。

下面是我使用的代码:

![](https://twitter.com/BIRASAFABRICE/photo)

我试图通过互联网进行搜索,但现有的解决方案对我没有帮助。这段代码哪里出错了?或者我需要怎么做?感谢您平时的帮助!

您需要将 link 获取到实际图像资源,而不是您的照片处于焦点位置的页面。

右击照片,检​​查元素,然后你会找到正确的link https://pbs.twimg.com/profile_images/1051755261583601666/roHaL2s1_400x400.jpg

然后您可以在 RMarkdown 文档中使用它。

正如@mhovd 所建议的,我检查了我想包含在 RMarkdown 文档中的图片,并使用以下代码以 jpg 格式读取它:

knitr::include_graphics("https://pbs.twimg.com/profile_images/1051755261583601666/roHaL2s1_400x400.jpg")