I've been working on a shiny app and would like to include a logo in the upper right corner of the app. How can I easily embed an image using shiny and r?
Thanks! K
Yes! A shiny app can be put in an iframe in another website from RStudio Connect. In order to put the app in an iframe, it is recommended to add a content URL, because you can move it to another piece of content should the need arise.
titlePanel allows to add easily images to the application title, by using: titlePanel(title = div(img(src="myAppImage. jpg"), "My App Name") It is also possible to add the title that should be displayed by the browser window with windowTitle as a parameter.
A Shiny app consists of two parts, a user interface ( ui ) and an R session that runs code and returns results ( server ). These two parts can be in their own files called ui. R and server.
I found another option that looks good for this app, so I'm sharing for others who want the image in the mainPanel.
mainPanel( img(src='myImage.png', align = "right"), ### the rest of your code )
Save the file in a www directory in the shinyApp directory:
| shinyApp/ | ui.R | server.R | www/ | myImage.png
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With