Trying to display image in R shiny

Hi Everyone,
I am trying to load an image from the www folder (this part works) and then using the image name to display it in the UI. When I try this I get the following error:
Warning: Error in cat: argument 1 (type 'closure') cannot be handled by 'cat'

Here is the fairly simple code

''' r
library(shiny)
library(imager)

setwd("E:/CIS590-03I Practical Research Project/Project")

ui object

ui <- fluidPage(
titlePanel(p("Dog Breed Classification", style = "color:#3474A7")),
sidebarLayout(
sidebarPanel(
fileInput("image",
"Select your image:", placeholder = "No file selected"),
tags$head(
tags$style("body .sidebar {background-color: white; }",
".well {background-color: white ;}"),
),

  p("Image to categorize"),
 
),
mainPanel(htmlOutput("testHTML"),
  )

)
)

server()

server <- shinyServer(function(input, output) {

    output$testHTML <- renderText({
    paste("<b>Selected image file is: ", input$image$name, "<br>")
      
      reactive(img(
        src = input$image$name,
        width = "250px", height = "190px"
      )  
    )

})
})

shinyApp()

shinyApp(ui = ui, server = server)

'''
Any help would be greatly appreciated.
Thank you,
Bill.

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.