在 R 中插入来自互联网的图像

我想从网上插入一张图片,这是我的代码,但它标记了一个错误,我已经阅读了手册并且我已经寻找了方法但我找不到方法

myft <- flextable( head(iris))
abajo<-"https://github.com/Temisesba/P-blico/raw/main/arriba.png"
myft <- compose( myft,i = 1:3,j = 1,value = as_paragraph(
                   as_image(src = abajo,width = .20,height = .15)," blah blah ",as_chunk(Sepal.Length)),part = "body")
myft
jp1004 回答:在 R 中插入来自互联网的图像

我们可以下载文件并插入

library(flextable)
download.file("https://github.com/Temisesba/P-blico/raw/main/arriba.png","arriba.png")

myft <- compose( myft,i = 1:3,j = 1,value = as_paragraph(
                   as_image(src = "arriba.png",width = .20,height = .15)," blah blah ",as_chunk(Sepal.Length)),part = "body")
myft

-输出

enter image description here

本文链接:https://www.f2er.com/3647.html

大家都在问