render Image not outputting Shiny

 output$plot <- renderImage({
  
outfile <- tempfile(fileext = '.png')
png(outfile, width = 400, height = 300)
venn.diagram(
  x = list(
    T = T,
    I = I
  ),
  main = "Venn Diagram ",
  filename =outfile, output=TRUE,
  lwd = 2,na = "remove",
  fill = c("orange", "blue"),
  alpha = c(0.5,0.5),
  label.col = "black",
  cex=1.5,
  fontface = "plain",
  cat.col = c("cornflowerblue", "pink"),
  cat.cex = 1.5,
  cat.fontfamily = "serif",
  cat.fontface = "plain",
  cat.dist = c(0.05, 0.05),
  cat.pos = c(-20, 14),
  cat.default.pos = "text",
  scaled = FALSE
)
dev.off()

list(src = outfile,
     contentType = 'image/png',
     width = 400,
     height = 300,
     alt = "This is alternate text")
}, deleteFile = TRUE)

I was trying plot a venn diagram using this code. But it only displays This is alternate text and not outputting any image on the app, Any Idea ?

Hi,

Issues with Shiny code can stem from both the reactive Shiny code itself or the regular R code used in the functions. In order for us to help you with your question, please provide us a minimal reproducible example (Reprex) where you provide a minimal (dummy) dataset and code that can recreate the issue. One we have that, we can go from there. For help on creating a Reprex, see this guide:

Good luck!
PJ

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.