Input picture into main panel


#1

Hello,

I am trying to input a picture into the main panel but it does not work. It draws the rectangular panel but the picture does not get inserted. This is the code I am using:

mainPanel(
        img(src = "~/Pictures/SWATH_Image_500PNG.PNG", height = 140, width = 400)
    )

Am I using the right code?


#2

The img tag is correct however you should create a www folder where your app.R file lives, and place the image called SWATH_Image_500PNG.PNG in there. Then, you can use

mainPanel(
        img(src = "SWATH_Image_500PNG.PNG", height = 140, width = 400)
    )

#3

Yes. That works. Thank you!