首页 > 解决方案 > 我们可以在 r shiny 应用程序的框中渲染多个图像吗?

问题描述

我正在尝试在 R Shiny 应用程序的一个框中渲染多个图像。对于图像,我指的是我拥有这些图像的位置。现在,当我在文件夹中只有 1 个图像时,图像会被渲染,但是一旦我在该位置有超过 1 个图像,它就不会渲染任何东西。

在服务器中使用以下代码创建该文件夹中存在的图像列表

output$images <- renderImage({
    
    file <- list.files('~/www', pattern=NULL, all.files=FALSE,full.names=T)
    
    file <- as.data.frame(file)
    
    filename <- normalizePath(file.path(file$file))
    
    filename <- as.list(filename)
    
    list(src = filename) # List gets created till this point but image is not rendered
    
  }, deleteFile = FALSE) 

标签: rshinyshinydashboardshiny-reactivity

解决方案


推荐阅读