title: renderImage() and .svg in shiny app
body: <p>I don't get <code>renderImage()</code>to work with a .svg file.
  My minimal example (<a href="http://shiny.rstudio.com/articles/images.html" rel="nofollow noreferrer">adapted from the corresponding RStudio-tutorial</a>):</p>
  <h3><strong>ui.R</strong></h3>
  <pre><code>shinyUI(pageWithSidebar(
    headerPanel(&quot;renderSVG example&quot;),
    sidebarPanel(
      sliderInput(&quot;obs&quot;, &quot;Number of observations:&quot;,
                  min = 0, max = 1000,  value = 500),
      actionButton(&quot;savePlot&quot;, &quot;savePlot&quot;)
    ),
    mainPanel(
      # Use imageOutput to place the image on the page
      imageOutput(&quot;plot&quot;),
      imageOutput(&quot;plot_as_svg&quot;)
    )
  ))
  </code></pre>
  <h3>server.R</h3>
  <pre><code>require(&quot;ggplot2&quot;)
  library(svglite)
  
  shinyServer(function(input, output, session) {
    
    ## create plot with renderPlot() 
    
  
        output$plot&lt;- renderPlot({
          hist(rnorm(input$obs), main=&quot;Generated in renderPlot()&quot;)
          })
  
    
    ## create .svg file of the plot and render it with renderImage() 
    
    output$plot_as_svg &lt;- renderImage({
      # A temp file to save the output.
      # This file will be removed later by renderImage
      outfile &lt;- tempfile(fileext='.svg')
      
      # Generate the svg
      svglite(outfile, width=400, height=300)
      hist(rnorm(input$obs), main=&quot;Generated in renderImage()&quot;)
      dev.off()
      
      # Return a list containing the filename
      list(src = outfile,
           contentType = 'text/svg+xml',
           width = 400,
           height = 300,
           alt = &quot;This is alternate text&quot;)
    }, deleteFile = TRUE)
    
  })
  </code></pre>
  <p>Any ideas where the problem is?</p>