gpt4 book ai didi

UI侧的R Shiny img()无法渲染图像

转载 作者:行者123 更新时间:2023-12-04 22:58:08 25 4
gpt4 key购买 nike

我正在尝试在Shiny UI中呈现的本地文件夹中有静态图像,但它不起作用。显示中间有问号的损坏图像。

ui <- fluidPage(img(src = 'imagefile.png', height = '100px', width = '100px'))
server <- function(input, output) {}
shinyApp(ui = ui, server = server)

知道发生了什么吗?

最佳答案

将图像放在同一目录中的www文件夹中,因此您具有www/imagefile.png。然后打电话

library(shiny)
ui <- fluidPage(img(src = 'imagefile.png', height = '100px', width = '100px'))
server <- function(input, output) {}
shinyAppDir(".")

但是,您可能希望将 runApp与单独的ui和服务器文件一起使用。

关于UI侧的R Shiny img()无法渲染图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35760656/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com