Bookdown - inserting a graphic image

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:

image

So the code does what I ask, but why is the knitr line also visible?

@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.

Doc is here:

and caption mechanism works the same as with plot, you can use the chunk option caption for include a caption to the image.

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.