2014-12-01 98 views
2

我對renderImage的deleteFile = FALSE參數有問題。總之它會刪除圖像文件。deleteFile = FALSE在renderImage不起作用

作爲短試驗例I具有ui.R

library(shiny)    
shinyUI(fluidPage(
    titlePanel("Testing ..."), 
    sidebarLayout( 
     sidebarPanel(),    
     mainPanel(
      imageOutput("f1") 
     ) 
    )  
)) 

和server.R

library(shiny) 

shinyServer(function(input, output,session) { 

    output$f1 <- renderImage({ 
     list(src="f1.png", deleteFile = FALSE) 
    }) 
}) 

其中f1.png是一些PNG圖像文件。當我運行它時,它顯示圖像正常,但也從文件夾中刪除它,正是deleteFile = FALSE應該不這樣做。

我在Win7機器上,以防萬一。

沃爾夫岡

補充:我現在找到另一種方式來做到這一點,利用

output$f1 <- renderText({ 
    HTML("<img src=\"f1.png\">") 
}) 
在ui.R

和uiOutput,這工作得很好,但原來的問題是,爲什麼有光澤刪除儘管deleteFile = FALSE參數的圖像文件?

沃爾夫岡

回答

3

嘗試:

library(shiny) 

shinyServer(function(input, output,session) { 

    output$f1 <- renderImage({ 
     list(src="f1.png") 
    }, deleteFile = FALSE) 
}) 
+0

沒錯,就是工作。 A)在錯誤的地方...... – 2014-12-03 19:42:10

相關問題