我比較新,很閃亮,所以我正在運行一些教程。不過,我在從閃亮的應用程序的「www」文件夾內的文件加載圖像時遇到問題。運行教程中閃亮的示例時丟失圖像
例如,當我運行下面的代碼時,我得到一個丟失的圖像。但是,如果我在線提及圖像,例如,如果用「http://shiny.rstudio.com/tutorial/lesson2/www/bigorb.png」代替「bigorb.png」,則可以毫無問題地獲得所需的圖像。我在Windows 10上使用R版本3.3.1。任何人都可以幫助我嗎?
ui <- shinyUI(fluidPage(
titlePanel("My Shiny App"),
sidebarLayout(
sidebarPanel(),
mainPanel(
img(src="bigorb.png", height = 400, width = 400)
)
)
))
server <- shinyServer(function(input, output) {
})
shinyApp(ui = ui, server = server)
你也可以添加鏈接:'IMG(SRC =「http://shiny.rstudio.com/tutorial/lesson2/www/bigorb.png 「,height = 400,width = 400)' –
感謝您的建議,我確實添加了該鏈接並且它可以正常工作,但我希望它也可以在我的計算機中的某個圖像上工作,而不是在線... –