I have an image i'd like to embed into my shiny app, and have read as much as I can find on how to do it. Although, all I get is a blue question mark when I run my code.
This is the line of code I have added, within the fluidPage
ui
command
img(src="logo.png", align = "right",height='100px',width='400px')
My image has been placed in the project directory folder, as well as trying in a separate folder inside named www (as per suggestion given here)
EDIT: Code used in the following context:
ui <- fluidPage(titlePanel("Test title"),
img(src="logo.png", align = "right",height='100px',width='400px'),
hr())
12.1 Adding an Image To include the image in your App, you'll need to make use of the image tag, img . When you run your App, Shiny automatically knows to check the www folder any time the img tag gets called.
After coming back to this problem, I found that the solution is to simply format the Shiny code properly, by naming the R file app.R
, and clicking Run App
as opposed to selecting all of the code and running within the console.
Not sure how or why this makes a difference, but the numerous Shiny applications I have worked on since have all been resolved when doing this.
I was having the same problem. To solve this, just create a folder named 'www' in the same folder as your app.R script and put the images within that folder.
I found the solution to this problem in the tutorial video in this page: Shiny Tutorial Video - Adding Static Content Watch from 1h45min00sec.
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