r Shiny : renderImage from www

标签 r shiny

renderImage尝试从 Internet 渲染图像时不起作用。当图像在本地机器上时它起作用。

  output$myImage <- renderImage({
    pfad <- "https://www.rstudio.com/wp-content/uploads/2014/03/blue-125.png"
    list(src = pfad,
         contentType = 'image/png',
         width = 400,
         height = 300,
         alt = "This is alternate text")
  }, deleteFile = F)


imageOutput("myImage")

最佳答案

您可以使用 tags$img直接在 ui 中或在响应式上下文中:

library("shiny")
ui <- fluidPage(
  fluidRow(
    column(
      6,
      tags$img(src = "https://www.rstudio.com/wp-content/uploads/2014/03/blue-125.png")
    ),
    column(
      6,
      uiOutput(outputId = "image")
    )
  )
)
server <- function(input, output) {
  output$image <- renderUI({
    tags$img(src = "https://www.rstudio.com/wp-content/uploads/2014/03/blue-125.png")
  })
}
shinyApp(ui = ui, server = server)

关于r Shiny : renderImage from www,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36600451/

相关文章:

mysql - "read.sql"R 中的函数 : Using R as an SQL browser?

r - 在 R 中需要一种有效的方法将彩色 utf-8 表情符号字符转换为其默认皮肤

将 apply 函数替换为 lapp

r - 更改 ggplot2 中特定刻度的颜色

r - 停止运行 Shiny 的应用程序键盘快捷键

r - renderImage 中的deleteFile = FALSE 不起作用

javascript - 如何在 Shiny 的某些单元格中创建带有空格的类似矩阵的复选框组?

javascript - R 中 Shiny 的 STRING 交互网络

r - 在 R 中处理日期和时间数据

r - Shiny 的验证不适用于零行数据帧?