标记$ img的以下代码是:
我需要将整个位置放在一个闪亮的应用程序中,该应用程序将在命令提示符下运行app.R文件。请帮忙谢谢..
library(shiny)
ui <- fluidPage(
box(
tags$img(height = 100, width = 100,src = "Rlogo.png"),
tags$img(height = 100, width = 100,src = "E:/myApp/www/Rlogo.png")
)
)
server <- function(input, output, session) {
}
shinyApp(ui, server)
答案 0 :(得分:0)
使用imageOutput
代替tags$img
:
library(shiny)
ui <- fluidPage(
box(
tags$img(height = 100, width = 100,src = "Rlogo.png"),
imageOutput('image')
)
)
server <- function(input, output, session) {
output$image <- renderImage({
list(src = "E:/myApp/www/Rlogo.png",
alt = "This is alternate text"
)
}, deleteFile = TRUE)
}
shinyApp(ui, server)