当我在 R 包结构中使用闪亮时,我的图像没有显示。
在我的 R 目录中,我有一个文件 myApp.R,其大纲如下:
@param1
myFunction = function(param1){
sidebar <- dashboardSidebar(...)
body <- dashboardBody(...)
ui <- dashboardPage(...)
server <- function(input, output, session) { img(src='Figure1.png')}
shinyApp(ui = ui, server = server)
}
Run Code Online (Sandbox Code Playgroud)
我尝试在 R/www 和 inst/www 中使用 Figure1.png,但是当我运行 myFunction(param1) 时,这两个位置似乎都没有创建数字。它将创建通用应用程序 - 但图像将不存在。
这个问题有简单的解决方法吗?谢谢你。