I and attempting to render a single jpg image using the minimal Bookdown setup.
Everything builds and knits fine in the original minimal bookdown state. When I add this one line of code just below '# Prerequisites,' the book incurs errors during the build process.
I've researched the error solutions to extent of my brain cells but cannot seem to locate the solution. The line of code works perfectly fine in R markdown, so it's not a file or directory does not exist issue.
When I knit the book, it produces the image in the proper position.
![](/Users/brianlee/Dropbox (Personal)/__bookdown_dfc/__derivations/flow_diagram.jpg)
Error messages are provided in linked image[![enter image description here][1]][1].
[1]: https://i.stack.imgur.com/K0u4B.jpg
Try to use HTML instead <img src= "/Users/brianlee/Dropbox (Personal)/__bookdown_dfc/__derivations/flow_diagram.jpg">
So I know how to show images ![Caption](/path/to/image.png) but I want the image to be saved on the html file so when I open the html file on someone else's computer I should be able to see the image. I will get an error message saying the path is wrong if I try to knit the .Rmd file.
The image is referenced absolutely on my computer but I don't want that. Is there a way to do?
I apologize in advance if this question is a duplicate, but I'm having trouble finding a proper solution. Thanks
A simple solution would be to import the image into R and then print it.
I have an .rmd file containing working code for a Shiny interactive knitr/rmarkdown doc. I want this doc to run via GitHub pages.
How do I do this? (Can someone walk me through the steps clearly and fully).
I understand I have to create a gh-pages branch and upload the files there. However, I don't understand what to do with my .rmd file. Do I simply just resave it as an .html file? Or does an html file have to contain something in addition to the rmd file?
Please help explain this to me -- I've spent all day trying to figure this out, but I can;t get anything to work right :(.
Prior effort: I tried following the lead given by this SO.post, but the best I can get is a screen full of block text. No formatting, code or images show up. Just the whole document's text.
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())
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.
Just a note that may be helpful to someone else, it just happened to me: please double check if your app.R is in the root directory. I.e, app.R is on the same level as the www folder. I know it seems trivial, but if you (as I just did) put app.R into a subfolder and click Run App, the app can still run, just without the pictures.
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.
You should check if the name of your R code file is called “app.R" instead of called xxx.R. this error also happened to me
I can use a() to add a hyperlink in to an external site from my Shiny app,
a("google",href="http://www.google.com")
but how do I make a link to open a pdf (or similar) file? Seems like it should be simple, but I can't find any examples. My question is similar to this one:
Add link to R Shiny Application so link opens in a new browser tab
but I don't know how to structure the href part- where do I put the file to be opened and how do I specify its location? I've tried simple things like http:///C:/Folder/file.pdf or file:///C:/Folder/file.pdf but the file is either not found or wont open.
I am new to shiny and have no html experience, so any suggestions greatly appreciated.
Thanks
Put the pdf file inside the "www" directory (it has to be a subdirectory inside the directory where there are ui.r and server.r )
then you can run your shiny with:
a("click on me",target="_blank",href="myfile.pdf")