【问题标题】:Rendering image from web source从网络源渲染图像
【发布时间】:2021-05-21 15:41:17
【问题描述】:

我已经在一个项目上工作了一段时间,我必须从网络存储库中渲染图像。 如果在 Rmarkdown 文件中工作,我找不到通过闪亮从网络渲染图像的方法。 有什么想法吗?

---
title: "Some Title"
author: "Me"
date: "`r format(Sys.time(), '%d/%m/%Y')`"
output: flexdashboard::flex_dashboard
runtime: shiny
---

```{r setup,include=FALSE}
##### Setup
# Setting base config
knitr::opts_chunk$set(echo = TRUE,label_list=TRUE,comment = "",fig.align = "center")# This will make figures appears in the center of the document
# Loading all required lib
lapply(c("knitr",
         "stringr"
         ),
       require,
       character.only = TRUE)
# Setting some other confing
options(xtable.floating = FALSE,xtable.timestamp = "",xtable.comment = FALSE)
link = "https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885__480.jpg"
renderImage({list(src = link)})

提前致谢,

【问题讨论】:

    标签: r shiny r-markdown


    【解决方案1】:

    经过一番搜索,我得到了这个解决方案:

    link = "https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885__480.jpg"
    renderUI({tags$img(src = link)})
    

    我很确定为什么它可以在 Rmarkdown 或其他方式中工作,并且肯定可以进行优化,无论如何,它都可以工作。 ^^

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-06-06
      • 2012-06-04
      • 2017-08-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多