I am now in day 2 of trying to learn RStudio, and the results have been mostly positive, but I have a problem inserting images in a bookdown book.
I write:
knitr::include_graphics("Images/FormToText-fMain.png")
The image is correctly inserted, but in my PDF I see this:
So the code does what I ask, but why is the knitr line also visible?
rgaiacs
September 17, 2022, 3:02pm
2
@wmeyer48 by default, bookdown will print the R code. You can avoid the code to be printed by using
```{r echo=FALSE}
knitr::include_graphics("Images/FormToText-fMain.png")
```
Though that solved the problem of inserting the graphic, I am now having no success trying to assign it a caption. I found nothing in the knitr docs for include_graphics which would help.
cderv
September 20, 2022, 8:52am
4
Doc is here:
A guide to authoring books with R Markdown, including how to generate figures and tables, and insert cross-references, citations, HTML widgets, and Shiny apps in R Markdown. The book can be exported to HTML, PDF, and e-books (e.g. EPUB). The...
and caption mechanism works the same as with plot, you can use the chunk option caption
for include a caption to the image.
system
Closed
September 27, 2022, 8:53am
5
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed. If you have a query related to it or one of the replies, start a new topic and refer back with a link.