2014-12-01 48 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

相关问题