【问题标题】:insert an image from the internet in R在R中插入来自互联网的图像
【发布时间】:2023-03-31 15:33:01
【问题描述】:

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

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

【问题讨论】:

    标签: r image


    【解决方案1】:

    我们可以下载文件并插入它

    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
    

    -输出

    【讨论】:

    • HERE 是一个您可能会喜欢的新问题。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-02-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多