I am using the Elsevier template from the R rticles package to produce a pdf document in Rstudio. For the paper I want to include a .png image. When I load the image with

things work fine but when I change this to the equivalent knitr command (which I prefer because it is easier to set fig size etc).
{r map, fig.cap="text"}
knitr::include_graphics("images/framework.png")
I get the following error:
! Paragraph ended before \Gin@iii was complete.
<to be read again>
When I switch to standard output setting for pdf in rmarkdown output:pdf_document the knitr option does work so I guess the problem must be related to the rticles package. I looked on the internet and think it might be related to using the \graphics package instead of the \graphicx latex package...
https://tex.stackexchange.com/questions/37650/paragraph-ended-before-giniii-was-complete-while-inserting-image-with-inclu
I tried adding the following in yaml:
header-includes:
- \usepackage{graphicx}
but the error remains.