Resources in www folder when deployed in ShinyApps.io

52 views
Skip to first unread message

Bryan Morrisey

unread,
Jul 15, 2014, 10:53:27 AM7/15/14
to shinyap...@googlegroups.com
I'm having trouble discovering the correct way to include an image in my project. Currently my app directory has the 'www' subdirectory, which in turn has an 'images' subdirectory. See below.

When I run the app locally using runApp(), all the images display correctly, but when I deploy the app to shinyapps.io, I get little broken image icons where all my images should be. In ui.R, I'm using the following code:

img(src="/images/icon.png")



Any hints on why this works locally but not when deployed?

Thanks!


Project structure:
  • App
    • server.R
    • ui.R
    • helpers.R
    • /www
      • /data
      • /images
        • icon.png


Chad Barraford

unread,
Jul 15, 2014, 11:13:38 AM7/15/14
to Bryan Morrisey, shinyap...@googlegroups.com
whats your app url?


--
You received this message because you are subscribed to the Google Groups "ShinyApps Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shinyapps-use...@googlegroups.com.
To post to this group, send email to shinyap...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shinyapps-users/b552fff5-ebf6-49bd-a9ca-6d493d67f308%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Fereshteh Karimeddini

unread,
Jul 15, 2014, 11:20:38 AM7/15/14
to shinyap...@googlegroups.com
Try changing this:
src="/images/icon.png"

to this:
src="images/icon.png"

Bryan Morrisey

unread,
Jul 15, 2014, 11:57:03 AM7/15/14
to shinyap...@googlegroups.com
Thanks for the suggestion, I'll give this a shot later today when I'm back to my workstation and post with results.

Bryan Morrisey

unread,
Jul 15, 2014, 10:05:59 PM7/15/14
to shinyap...@googlegroups.com
Removing the leading '/' from the path solved this problem. Thanks.
Reply all
Reply to author
Forward
0 new messages